首页 > 其他 > 详细

error: ‘module’ object has no attribute ‘_rebuild_tensor_v2’

时间:2018-08-16 21:30:22      阅读:496      评论:0      收藏:0      [点我收藏+]

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’

原文:https://www.cnblogs.com/huhuai/p/9489920.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!