浏览代码

autocast enable=torch.cuda.is_available() (#2748)

5.0
Glenn Jocher GitHub 3 年前
父节点
当前提交
fca5e2a48f
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      models/common.py

+ 1
- 1
models/common.py 查看文件

@@ -237,7 +237,7 @@ class autoShape(nn.Module):
return self

@torch.no_grad()
@torch.cuda.amp.autocast()
@torch.cuda.amp.autocast(torch.cuda.is_available())
def forward(self, imgs, size=640, augment=False, profile=False):
# Inference from various sources. For height=640, width=1280, RGB images example inputs are:
# filename: imgs = 'data/samples/zidane.jpg'

正在加载...
取消
保存