9d5c022d00ae5b0e4e864e951b67f729cdfa14ce,intermediate_source/named_tensor_tutorial.py,,,#,108

Before Change


// dimension? One way, involving names, would be to name the ``per_batch_scale``
// tensor such that it matches ``imgs.names``, as shown below.

imgs = torch.randn(6, 6, 6, 6, names=("N", "C", "H", "W"))
per_batch_scale_4d = torch.rand(6, 1, 1, 1, names=("N", "C", "H", "W"))
print((imgs * per_batch_scale_4d).names)

After Change


loss.backward(grad_loss)

correct_grad = weight.grad.clone()
print(correct_grad)  // Unnamed for now. Will be named in the future

weight.grad.zero_()
grad_loss = grad_loss.refine_names("C")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: pytorch/tutorials
Commit Name: 9d5c022d00ae5b0e4e864e951b67f729cdfa14ce
Time: 2019-10-09
Author: zou3519@gmail.com
File Name: intermediate_source/named_tensor_tutorial.py
Class Name:
Method Name:


Project Name: erikwijmans/Pointnet2_PyTorch
Commit Name: 803d7e1fc61536c846c811bdee158bd21db36779
Time: 2017-12-26
Author: ewijmans2@gmail.com
File Name: models/Pointnet2Cls.py
Class Name:
Method Name:


Project Name: pytorch/tutorials
Commit Name: ce58d5904c04c4be10561447e41a153f573a3f93
Time: 2020-12-03
Author: qasdfgtyuiop@gmail.com
File Name: beginner_source/examples_nn/dynamic_net.py
Class Name:
Method Name: