Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Hackathon No.48】为 Paddle meshgrid 算子实现 float16 数据类型支持 #53284

Merged
merged 1 commit into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions paddle/phi/kernels/gpu/meshgrid_grad_kernel.cu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ PD_REGISTER_KERNEL(meshgrid_grad,
GPU,
ALL_LAYOUT,
phi::MeshgridGradKernel,
phi::dtype::float16,
float,
double,
int,
Expand Down
1 change: 1 addition & 0 deletions paddle/phi/kernels/gpu/meshgrid_kernel.cu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ PD_REGISTER_KERNEL(meshgrid,
GPU,
ALL_LAYOUT,
phi::MeshgridKernel,
phi::dtype::float16,
float,
double,
int,
Expand Down
8 changes: 8 additions & 0 deletions python/paddle/fluid/tests/unittests/test_meshgrid_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ def get_x_shape(self):
return [100, 300]


class TestMeshgridOp2Fp16(TestMeshgridOp):
def get_x_shape(self):
return [100, 300]

def get_dtype(self):
return np.float16


class TestMeshgridOp3(unittest.TestCase):
def test_api(self):
x = paddle.static.data(shape=[100], dtype='int32', name='x')
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/tensor/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,7 @@ def meshgrid(*args, **kwargs):

Args:
*args(Tensor|list of Tensor) : tensors (tuple(list) of tensor): the shapes of input k tensors are (N1,),
(N2,),..., (Nk,). Support data types: ``float64``, ``float32``, ``int32``, ``int64``.
(N2,),..., (Nk,). Support data types: ``float64``, ``float16``, ``float32``, ``int32``, ``int64``.
**kwargs (optional): Currently, only accept name in **kwargs
The default value is None. Normally there is no need for
user to set this property. For more information, please refer to :ref:`api_guide_Name`.
Expand Down