Skip to content

Conversation

fadel
Copy link
Contributor

@fadel fadel commented Jan 24, 2019

The documentation stated that operands to einsum should be a list of Tensors, not individual arguments. The function, however, now accepts individual arguments for each Tensor operand and a single argument consisting of a list of Tensors. The documentation was updated to reflect this change.

The documentation stated that operands to einsum should be a list of Tensors, not individual arguments. The function, however, now accepts individual arguments for each Tensor operand *and* a single argument consisting of a list of Tensors. The documentation was updated to reflect this change.
@fadel fadel changed the title Update einsum documentation. [doc] Update einsum documentation. Jan 25, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soumith is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@soumith
Copy link
Member

soumith commented Jan 27, 2019

thanks!

@Dominik1123
Copy link
Contributor

The docstring still states that operands should be of type list of Tensors. According to PEP 484 on type hints, packed arguments should be annotated such that the hint applies to each single argument, i.e. *operands: Tensor. Hence the same should apply to doc string type hints, i.e. operands should be declared Tensor instead of list of Tensors.

With the current docstring version, IDEs such as PyCharm issue warnings that the remaining positional arguments to einsum should be of type List instead of Tensor because they infer this type from the docstring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants