Skip to content

paddle应该增加 tensor == None 比较运算 #75677

@liuqi45

Description

@liuqi45

需求描述 Feature Description

写迭代式求解方程组代码时,有时传递初始值向量,有时不传递。需要对接受初始值向量的变量x与None做比较运算。 当传递给x向量后,x与 None 做判等运算出现报错了

import paddle

x = paddle.zeros((2,2))
if(x == None):                  #这里会报错
    print('x是None')
else:
    print('x不是None')
    

### 替代实现 Alternatives

_No response_

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions