PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
21.8k stars 5.47k forks source link

paddle对应torch中torch.cfloat数据类型缺失 #56988

Open zlynna opened 10 months ago

zlynna commented 10 months ago

需求描述 Feature Description

在复现论文Physics-informed neural operator for learning part的过程中, Fourier Neural Operator 网络在原pytorch代码环境中涉及到fft的网络训练参数的数据类型为torch.cfloat,paddle.create_parameter不支持cfloat,即complex64数据类型,请问是否可以在paddle中实现对该数据类型的支持?

替代实现 Alternatives

No response

wanghuancoder commented 10 months ago

你好,你可以直接传入dtype="complex64"

wangguan1995 commented 7 months ago

image

wangguan1995 commented 7 months ago

image

weight = paddle.randn([32, 32, 8, 8]).astype("complex64")
weight = paddle.create_parameter(weight.shape, weight.dtype, attr=paddle.nn.initializer.Assign(weight))