摘要: pytorch 常见错误 RuntimeError: a leaf Variable that requires grad is being used in an in-place operation. 如下程序会抱上述错误 x=torch.randn(3,requires_grad=True) x 阅读全文
posted @ 2024-08-27 23:00 金字塔下的蜗牛 阅读(127) 评论(0) 推荐(0) 编辑
摘要: import torch import os import numpy as np import random def synthetic_data(w, b, num_examples): ''' 产生data ''' features = torch.normal(0,1,(num_exampl 阅读全文
posted @ 2024-08-27 22:51 金字塔下的蜗牛 阅读(10) 评论(0) 推荐(0) 编辑