ysn-rfd's picture
Upload 26 files
835424e verified
raw
history blame contribute delete
260 Bytes
import torch as t
import torch.nn as nn
import numpy as np
x = t.tensor(1., requires_grad=True)
w = t.tensor(2., requires_grad=True)
b = t.tensor(3., requires_grad=True)
y = w*x+b
y.backward()
print(x.grad)
print(w.grad)
print(b.grad)