2b79f10398105048a22cb9f03062240e50dff84a,tensorly/backend/pytorch_backend.py,,,#,10
Before Change
from torch import qr
from torch import is_tensor
dtypes = ["int64", "int32", "float32", "float64"]
for dtype in dtypes:
vars()[dtype] = getattr(torch, dtype)
// Order 0 tensor, mxnet....
from math import sqrt as scalar_sqrt
// Equivalent functions in pytorch
maximum = max
After Change
from . import _generics, numpy_backend
backend = _generics.new_backend("pytorch")
for name in ["float64", "float32", "int64", "int32", "is_tensor", "ones",
"zeros", "zeros_like", "reshape", "eye", "max", "min", "prod",
"abs", "sqrt", "sign", "where", "qr"]:
backend.register(getattr(torch, name), name=name)
backend.register(torch.matmul, name="dot")
@backend.register
def context(tensor):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 24
Instances
Project Name: tensorly/tensorly
Commit Name: 2b79f10398105048a22cb9f03062240e50dff84a
Time: 2018-09-27
Author: jiminy.crist@gmail.com
File Name: tensorly/backend/pytorch_backend.py
Class Name:
Method Name:
Project Name: tensorly/tensorly
Commit Name: 2b79f10398105048a22cb9f03062240e50dff84a
Time: 2018-09-27
Author: jiminy.crist@gmail.com
File Name: tensorly/backend/pytorch_backend.py
Class Name:
Method Name:
Project Name: tensorly/tensorly
Commit Name: b9dbf5d7b005afe69aee7bf500f8caf721e57708
Time: 2018-09-28
Author: jiminy.crist@gmail.com
File Name: tensorly/backend/cupy_backend.py
Class Name:
Method Name:
Project Name: tensorly/tensorly
Commit Name: 6dcb645ed16ee44a53f68576c5812774cd9485f1
Time: 2018-09-27
Author: jiminy.crist@gmail.com
File Name: tensorly/backend/numpy_backend.py
Class Name:
Method Name: