def type(self, type, tensorCache=None):
# find all tensors and convert them
for key, param in self.__dict__.items():
setattr(self, key, recursiveType(param, type, tensorCache or {}))
self._backend = torch._thnn.type2backend[type]
return self
评论列表
文章目录