EADST

Paddle: paddle.multiply and paddle.matmul

Paddle: paddle.multiply and paddle.matmul

import paddle

x = paddle.to_tensor([[1, 2], [3, 4]], dtype='float32')
y = paddle.to_tensor([[5, 6], [7, 8]], dtype='float32')

res_multiply = paddle.multiply(x, y)
print(res_multiply) # Tensor(shape=[2, 2], dtype=float32, place=CUDAPlace(0), stop_gradient=True, [[5. , 12.], [21., 32.]])


res_matmul = paddle.matmul(x, y)
print(res_matmul.numpy()) # [[19., 22.] [43., 50.]]

References:

Paddle API 文档

Paddle API Reference

相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
站点统计

本站现有博文242篇,共被浏览287200

本站已经建立1770天!

热门文章
文章归档
回到顶部