API 相关说明
逐元素相加。
实际案例
import numpy as np from megengine import tensor import megengine.functional as F x = tensor(np.arange(0, 6, dtype=np.float32).reshape(2, 3)) y = tensor(np.arange(0, 6, dtype=np.float32).reshape(2, 3)) out = F.add(x, y) print(out.numpy())
输出:
[[ 0. 2. 4.] [ 6. 8. 10.]]
上一页
megengine.functional.roll
下一页
megengine.functional.sub