mindspore.ops.ger
- mindspore.ops.ger(input, vec2)[source]
Ger product of input and vec2. Calculate the outer product of two arrays. If input is a 1D Tensor of shape \((m,)\) and vec2 is a 1D Tensor of shape \((n,)\), then output must be a 2D Tensor of shape \((m, n)\).
Note
Currently Ascend does not support float64 data input.
- Parameters
- Returns
Tensor, output matrix with the same dtype as inputs. With input shape \((m,)\) and vec2 shape of \((n,)\), the output has shape \((m, n)\).
- Raises
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> from mindspore import Tensor, ops >>> input = Tensor([1., 2., 3., 4.], mindspore.float32) >>> vec2 = Tensor([1., 2., 3.], mindspore.float32) >>> output = ops.ger(input, vec2) >>> print(output) [[ 1. 2. 3.] [ 2. 4. 6.] [ 3. 6. 9.] [ 4. 8. 12.]]