未验证 提交 bb8203cd 编写于 作者: A Aurelius84 提交者: GitHub

Fix concat and tile attribute for 2ONNX (#44658)

* Fix concat and tile attribute for ONNX

* disable unittest
上级 7aeec4ed
......@@ -93,7 +93,7 @@ class TestTileTensorList(UnittestBase):
self.shapes = [[2, 3, 4]]
self.save_path = os.path.join(self.temp_dir.name, 'tile_tensors')
def test_static(self):
def _test_static(self):
main_prog = Program()
starup_prog = Program()
with program_guard(main_prog, starup_prog):
......@@ -127,7 +127,7 @@ class TestTileTensor(UnittestBase):
self.shapes = [[2, 3, 4]]
self.save_path = os.path.join(self.temp_dir.name, 'tile_tensor')
def test_static(self):
def _test_static(self):
main_prog = Program()
starup_prog = Program()
with program_guard(main_prog, starup_prog):
......
......@@ -1117,7 +1117,9 @@ def concat(x, axis=0, name=None):
attrs = {}
if isinstance(axis, Variable):
axis.stop_gradient = True
attrs['axis'] = axis
inputs['AxisTensor'] = axis
else:
attrs['axis'] = axis
helper.append_op(type='concat',
inputs=inputs,
......@@ -2935,11 +2937,13 @@ def tile(x, repeat_times, name=None):
if isinstance(repeat_times, Variable):
repeat_times.stop_gradient = True
attrs['repeat_times'] = repeat_times
inputs['RepeatTimes'] = repeat_times
attrs['repeat_times'] = [-1]
elif isinstance(repeat_times, (list, tuple)):
attrs['repeat_times'] = get_attr_repeat_times(repeat_times)
if utils._contain_var(repeat_times):
attrs['repeat_times'] = utils._convert_to_tensor_list(repeat_times)
inputs['repeat_times_tensor'] = utils._convert_to_tensor_list(
repeat_times)
dtype = helper.input_dtype(input_param_name='x')
out = helper.create_variable_for_type_inference(dtype)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册