error: ‘module’ object has no attribute ‘_rebuild_tensor_v2’
Posted huhuai
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了error: ‘module’ object has no attribute ‘_rebuild_tensor_v2’相关的知识,希望对你有一定的参考价值。
import torch._utils
try:
torch._utils._rebuild_tensor_v2
except AttributeError:
def _rebuild_tensor_v2(storage, storage_offset, size, stride, requires_grad, backward_hooks):
tensor = torch._utils._rebuild_tensor(storage, storage_offset, size, stride)
tensor.requires_grad = requires_grad
tensor._backward_hooks = backward_hooks
return tensor
torch._utils._rebuild_tensor_v2 = _rebuild_tensor_v2
以上是关于error: ‘module’ object has no attribute ‘_rebuild_tensor_v2’的主要内容,如果未能解决你的问题,请参考以下文章
vs2008中,很急很急!!error LNK2001: 无法解析的外部符号 "int i" (?i@@3HA)咋解决
error LNK2001: unresolved external symbol "int g_cTemplates" (?g_cTemplates@@3HA)(转)
异常:Error response from daemon: conflict: unable to delete 6fa48e047721 (cannot be forced) - image ha