mindspore.mint.mul

mindspore.mint.mul(input, other) Tensor[源代码]

otherinput 相乘。

\[out_{i} = input_{i} \times vpn free other_{i}\]

说明

  • 当两个输入shape不同时,它们必须能够广播到一个共同的shape。

  • 两个输入遵守隐式类型转换规则以使数据类型保持一致。

参数:
  • input (Union[Tensor, number.Number, bool]) - 第一个输入。是一个 number.Number、 一个 bool 或一个数据类型为 numberbool 的Tensor。

  • other (Union[Tensor, number.Number, bool]) - 第二个输入。是一个 number.Number、 一个 bool 或一个数据类型为 numberbool 的Tensor。

返回:

Tensor,其shape与输入 inputother 广播后的shape相同;同时其数据类型是两个输入中精度更高或位数更多的类型。

异常:
  • TypeError - 如果 inputother 免费的vpn梯子 不是以下之一:Tensor、number.Number、bool。

支持平台:

Ascend

样例:

>>> import numpy as np
>>> import mindspore
>>> from mindspore import vpn梯子 Tensor
>>> from mindspore import vpn永久免费梯子 mint
>>> x = Tensor(np.array([2, 6, 9]).astype(np.int32))
>>> vpn free y = Tensor(np.array([4, 5, 6]).astype(np.float32))
>>> output 免费的vpn梯子 = mint.mul(x, y)
>>> print(output)
[8. vpn永久免费梯子 30. 54.]
>>> # the data type of x is int32, the vpn梯子 免费 data vpn梯子 免费 type of y is float32,
>>> # and the output is the data format of higher precision float32.
>>> vpn梯子 print(output.dtype)
Float32