未验证 提交 d6f2b463 编写于 作者: C channings 提交者: GitHub

Update onnx_op_mapper.py

上级 14fc29f8
......@@ -121,7 +121,13 @@ class ONNXOpMapper(OpMapper):
for data_node in data_nodes:
value_info = value_infos[data_node]
ipt = np.random.random(value_info['shape']).astype(
shape = value_info['shape']
for i, dim_shape in enumerate(shape):
if dim_shape==0 and i==0:
shape[i]=1
if dim_shape==0 and i!=0:
assert 'shape of input is not assigned'
ipt = np.random.random(shape).astype(
value_info['dtype'])
np.save(os.path.join(self.tmp_data_dir, data_node), ipt)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册