mindspore/docs/api/api_python/ops/mindspore.ops.func_einsum.rst

18 lines
979 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.einsum
====================
.. py:function:: mindspore.ops.einsum(equation, *operands)
基于爱因斯坦求和约定Einsum符号沿指定维度计算输入tensor元素的乘积之和。
.. note::
- 现在支持子列表模式。例如ops.einsum(op1, sublist1, op2, sublist2, ..., sublist_out)。在子列表模式中, `equation` 由子列表推导得到Python的省略号和介于[0, 52)的整数list组成子列表。每个操作数后面都有一个子列表并且最后有一个表示输出的子列表。
- `equation` 只能包含字母、逗号、省略号和箭头。字母表示输入tensor维数逗号表示单独的tensor省略号表示忽略的tensor维数箭头的左边表示输入tensor右边表示期望输出的维度。
参数:
- **equation** (str) - 基于爱因斯坦求和约定的符号。
- **operands** (Tensor) - 输入tensor。
返回:
Tensor