1761555758e76f8e403549a75651d4b31a8a9fc2,intermediate_source/named_tensor_tutorial.py,,,#,35

Before Change


// - A named dim can only be refined to have the same name.

print(imgs.names)
print(imgs.refine_names("N", "C", "H", "W").names)

// Coerces the last two dims to "H" and "W". In Python 2, use the string "..." instead of ...
print(imgs.refine_names(..., "H", "W").names)

After Change


// - A ``None`` dim can be refined to have any name
// - A named dim can only be refined to have the same name.

imgs = torch.randn(3, 1, 1, 2)
named_imgs= imgs.refine_names("N", "C", "H", "W")
print(named_imgs.names)

// Coerces the last two dims to "H" and "W". In Python 2, use the string "..." instead of ...
print(imgs.refine_names(..., "H", "W").names)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: pytorch/tutorials
Commit Name: 1761555758e76f8e403549a75651d4b31a8a9fc2
Time: 2019-10-07
Author: sethweidman@fb.com
File Name: intermediate_source/named_tensor_tutorial.py
Class Name:
Method Name:


Project Name: streamlit/streamlit
Commit Name: 26b8e58826ae4a450bcc768ced8f59329587fbf2
Time: 2018-03-18
Author: adrien.g.treuille@gmail.com
File Name: examples/new.py
Class Name:
Method Name:


Project Name: SPFlow/SPFlow
Commit Name: 8406abaa40c9d42e4528285024a7b3ba7596a1e6
Time: 2018-06-10
Author: molina@cs.tu-darmstadt.de
File Name: src/spn/gpu/Pytorch.py
Class Name:
Method Name: