This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import importlib | |
import torch | |
def test_supported_dtypes(device): | |
dtypes = [ | |
torch.bool, | |
torch.uint8, | |
torch.int8, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import importlib | |
import time | |
import torch | |
def benchmark_dtype(dtype, device, size, repeat): | |
try: | |
# 创建两个张量 | |
a = torch.randn((size, size), dtype=dtype, device=device) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// go version of https://gist.github.com/javiermon/43a0b9e1c07abd4b13df | |
import ( | |
"log" | |
"github.com/jsimonetti/rtnetlink" | |
"fmt" | |
) |