qibo
qibo copied to clipboard
The `tensordot` function is not consistent throughout different backends
When I try to call the function tensordot
from different backends, the arguments are not consistent:
if self._backend.__class__.__name__ == "PyTorchBackend":
tensor = self._backend.np.tensordot(tensor0, tensor1, dims=([1],[0]))
else:
tensor = self._backend.np.tensordot(tensor0, tensor1, axes=(1,0))
The argument axes
is named dims
in PyTorchBackend
, which is different from all other backends. Also, the type of argument is different. While other backends support tuple
of numbers for axes
, the PyTorchBackend
only support tuple
of list
.