to_tensor接口 接口功能将数据转换为torch.tensor。 接口实现def to_tensor(self, data): return torch.tensor(data, device=self.device) 参数说明 参数名称 是否必选 类型 默认值 描述 data 是 ndarry - 待转为torch.tensor的数据。 父主题: generator_torch.py提供Python接口