qibo icon indicating copy to clipboard operation
qibo copied to clipboard

The `tensordot` function is not consistent throughout different backends

Open Canoming opened this issue 9 months ago • 2 comments

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.

Canoming avatar May 27 '24 06:05 Canoming