Replace legacy tensor.Tensor with torch.tensor/torch.empty (#12027)

* Replace legacy torch.Tensor constructor with torch.{tensor, empty}

* Remove torch.Tensor in examples
This commit is contained in:
Mario Šaško
2021-06-08 05:58:38 -07:00
committed by GitHub
parent e33085d648
commit f5eec0d8e9
13 changed files with 26 additions and 22 deletions

View File

@@ -532,7 +532,7 @@ def load_frcnn_pkl_from_url(url):
for k, v in model.items():
new[k] = torch.from_numpy(v)
if "running_var" in k:
zero = torch.Tensor([0])
zero = torch.tensor([0])
k2 = k.replace("running_var", "num_batches_tracked")
new[k2] = zero
return new