"torchvision/git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "6eac421ca2ea1ca52f49e10d7ac191c0d6900df1"
Commit 1fa2f866 authored by ekka's avatar ekka Committed by Francisco Massa
Browse files

change tensor to as_tensor (#810)

parent 6eac421c
......@@ -203,8 +203,8 @@ def normalize(tensor, mean, std, inplace=False):
if not inplace:
tensor = tensor.clone()
mean = torch.tensor(mean, dtype=torch.float32, device=tensor.device)
std = torch.tensor(std, dtype=torch.float32, device=tensor.device)
mean = torch.as_tensor(mean, dtype=torch.float32, device=tensor.device)
std = torch.as_tensor(std, dtype=torch.float32, device=tensor.device)
tensor.sub_(mean[:, None, None]).div_(std[:, None, None])
return tensor
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment