multi_mode_dot#

ivy.multi_mode_dot(x, mat_or_vec_list, /, modes=None, skip=None, transpose=False, *, out=None)[source]#

N-mode product of a tensor and several matrices or vectors over several modes.

Parameters:
  • x (Union[Array, NativeArray]) – the input tensor

  • mat_or_vec_list (Sequence[Union[Array, NativeArray]]) – sequence of matrices or vectors of length tensor.ndim

  • skip (Optional[Sequence[int]], default: None) – None or int, optional, default is None If not None, index of a matrix to skip.

  • modes (Optional[Sequence[int]], default: None) – None or int list, optional, default is None

  • transpose (Optional[bool], default: False) – If True, the matrices or vectors in in the list are transposed. For complex tensors, the conjugate transpose is used.

  • out (Optional[Array], default: None) – optional output array, for writing the result to. It must have a shape that the result can broadcast to.

Return type:

Array

Returns:

ivy.Array – tensor times each matrix or vector in the list at mode mode

Notes

If no modes are specified, just assumes there is one matrix or vector per mode and returns: \(\\text{x }\\times_0 \\text{ matrix or vec list[0] }\\times_1 \\cdots \\times_n \\text{ matrix or vec list[n] }\)

Array.multi_mode_dot(self, mat_or_vec_list, /, modes=None, skip=None, transpose=False, *, out=None)[source]#

ivy.Array instance method variant of ivy.multi_mode_dot. This method simply wraps the function, and so the docstring for ivy.multi_mode_dot also applies to this method with minimal changes.

Parameters:
  • self (Union[Array, NativeArray]) – the input tensor

  • mat_or_vec_list (Sequence[Union[Array, NativeArray]]) – sequence of matrices or vectors of length tensor.ndim

  • skip (Optional[Sequence[int]], default: None) – None or int, optional, default is None If not None, index of a matrix to skip.

  • modes (Optional[Sequence[int]], default: None) – None or int list, optional, default is None

  • transpose (Optional[bool], default: False) – If True, the matrices or vectors in in the list are transposed. For complex tensors, the conjugate transpose is used.

  • out (Optional[Array], default: None) – optional output array, for writing the result to. It must have a shape that the result can broadcast to.

Return type:

Array

Returns:

ivy.Array – tensor times each matrix or vector in the list at mode mode

Notes

If no modes are specified, just assumes there is one matrix or vector per mode and returns: \(\\text{x }\\times_0 \\text{ matrix or vec list[0] }\\times_1 \\cdots \\times_n \\text{ matrix or vec list[n] }\)

Container.multi_mode_dot(self, mat_or_vec_list, /, modes=None, skip=None, transpose=False, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

ivy.Container instance method variant of ivy.multi_mode_dot. This method simply wraps the function, and so the docstring for ivy.multi_mode_dot also applies to this method with minimal changes.

Parameters:
  • self (Union[Array, NativeArray, Container]) – the input tensor

  • mat_or_vec_list (Sequence[Union[Container, Array, NativeArray]]) – sequence of matrices or vectors of length tensor.ndim

  • modes (Optional[Union[Sequence[int], Container]], default: None) – None or int list, optional, default is None

  • skip (Optional[Union[Sequence[int], Container]], default: None) – None or int, optional, default is None If not None, index of a matrix to skip.

  • transpose (Optional[Union[bool, Container]], default: False) – If True, the matrices or vectors in in the list are transposed. For complex tensors, the conjugate transpose is used.

  • out (Optional[Container], default: None) – optional output array, for writing the result to. It must have a shape that the result can broadcast to.

Return type:

Container

Returns:

ivy.Container – tensor times each matrix or vector in the list at mode mode