mindspore.ops.outer
- mindspore.ops.outer(input, vec2)[source]
Compute outer product of two tensors.
If input ’s length is
and vec2 ’s length is , then output must be a matrix of shape .Note
This function does not broadcast.
- Parameters
- Returns
Tensor
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> input = mindspore.tensor([1, 2, 3]) >>> vec2 = mindspore.tensor([4, 5, 6]) >>> mindspore.ops.outer(input, vec2) Tensor(shape=[3, 3], dtype=Int64, value= [[ 4, 5, 6], [ 8, 10, 12], [12, 15, 18]])