diff --git a/paddle/phi/api/yaml/legacy_ops.yaml b/paddle/phi/api/yaml/legacy_ops.yaml index 7f25ba6be4812f2629ecd716b74822022c36d3cb..bca2aeb58a50721f04bed7d86b3761379fa353f4 100755 --- a/paddle/phi/api/yaml/legacy_ops.yaml +++ b/paddle/phi/api/yaml/legacy_ops.yaml @@ -648,12 +648,15 @@ backward : cumsum_grad - op : decode_jpeg - args : (Tensor x, str mode) + args : (Tensor x, str mode, Place place) output : Tensor(out) infer_meta : func : DecodeJpegInferMeta + param : [x, mode] kernel : func : decode_jpeg + param : [x, mode] + backend : place - op : deformable_conv args : (Tensor x, Tensor offset, Tensor filter, Tensor mask, int[] strides, int[] paddings, int[] dilations, int deformable_groups, int groups, int im2col_step) diff --git a/python/paddle/vision/ops.py b/python/paddle/vision/ops.py index b8a0fa7ee22c13f7b01a5b6c39d2b34ee64978bc..11bedb6c3177c36150ef12d923c3594ab71b8b98 100755 --- a/python/paddle/vision/ops.py +++ b/python/paddle/vision/ops.py @@ -22,6 +22,7 @@ from ..fluid.initializer import Normal from ..fluid.framework import _non_static_mode, in_dygraph_mode, _in_legacy_dygraph from paddle.common_ops_import import * from paddle import _C_ops, _legacy_C_ops +from ..framework import _current_expected_place __all__ = [ #noqa 'yolo_loss', 'yolo_box', 'deform_conv2d', 'DeformConv2D', @@ -1020,7 +1021,9 @@ def decode_jpeg(x, mode='unchanged', name=None): print(img.shape) """ - if _non_static_mode(): + if in_dygraph_mode(): + return _C_ops.decode_jpeg(x, mode, _current_expected_place()) + elif _non_static_mode(): return _legacy_C_ops.decode_jpeg(x, "mode", mode) inputs = {'X': x}