摘要: 使用__iter__, __getitem__来模拟数据处理部分 import torch.utils.data class Model(): def __init__(self, animal_list): self.animal_list = animal_list # 根据迭代batch_si 阅读全文
posted @ 2020-04-20 16:26 python我的最爱 阅读(1133) 评论(1) 推荐(1) 编辑
摘要: # 构建apply函数体 from torch.nn import init import torch class A: def __init__(self): self.weight = torch.tensor([0.0, 0.0]) self.bias = 0 pass def apply(s 阅读全文
posted @ 2020-04-20 16:17 python我的最爱 阅读(3391) 评论(0) 推荐(0) 编辑