1、、Tensors are similar to NumPy’s ndarrays, with the addition being that Tensors can also be used on a GPU to accelerate computing.

2、、Any operation that mutates a tensor in-place is post-fixed with an ``_``.

# For example: ``x.copy_(y)``, ``x.t_()``, will change ``x``.


3、、You need to clear the existing gradients though, else gradients will be accumulated to existing gradients.

net.zero_grad() # zeroes the gradient buffers of all parameters

4、、

print(loss.grad_fn.next_functions[0][0].next_functions[0][0])

5、、

 

posted on 2018-10-28 16:41  MicN  阅读(108)  评论(0编辑  收藏  举报