Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The tensordot function is not consistent throughout different backends #1334

Open
Canoming opened this issue May 27, 2024 · 2 comments
Open

Comments

@Canoming
Copy link
Contributor

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.

@Simone-Bordoni
Copy link
Contributor

We are planning on defining the function tensordot in the abstract backend. For now a good solution is using matmul that seems to work in the same way for all backends.

@renatomello
Copy link
Contributor

@Canoming @Simone-Bordoni can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants