Skip to content

[Feature Request] tensordot #8988

@jcmgray

Description

@jcmgray

tensordot would be a useful function to have for general contractions between tensors. It looks like all the basic functionality is already present, but not a numpy-matching api. One nice gain if this was present would be that pytorch could be used as a backend by opt_einsum for order-optimized tensor contractions.

Two simple and purely python options would be:

  1. a dot/matmul based method - like this gist (adapted from numpy's implementation itself I think)
  2. an einsum based method - like in this PR (not for pytorch but similarly translates tensordot calls to einsum calls)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions