Skip to content

paddle的element-wise加减乘除不支持浮点类型与整型tensor之间运算 #75675

@liuqi45

Description

@liuqi45

bug描述 Describe the Bug

import paddle
a = paddle.zeros((2,2),dtype = paddle.float64)
b = paddle.zeros((2,2),dtype = paddle.int64)
c = a * b
print(c)

错误信息:
TypeError: (InvalidType) Type promotion only support calculations between floating-point numbers and between complex and real numbers. But got different data type x: float64, y: int64. (at ..\paddle/phi/common/type_promotion.h:233)

其他补充信息 Additional Supplementary Information

pytorch支持同样运算

import torch
a = torch.zeros((2,2),dtype = torch.float64)
b = torch.zeros((2,2),dtype = torch.int64)
c = a * b
print(c)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions