未验证 提交 c7da8602 编写于 作者: Y YuanRisheng 提交者: GitHub

add decode_jpeg yaml (#46562)

上级 0ee6dfbe
......@@ -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)
......
......@@ -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}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册