def create_net_const(self, shape, scale, precision, ir_version):
    '\n            ONNX net                                     IR net\n\n            Input->Concat(+scaled const)->Output   =>    Input->Concat(+const)\n\n        '
    import onnx
    from onnx import helper
    from onnx import TensorProto
    concat_axis = 0
    output_shape = shape.copy()
    output_shape[concat_axis] *= 2
    input = helper.make_tensor_value_info('input', TensorProto.FLOAT, shape)
    output = helper.make_tensor_value_info('output', TensorProto.FLOAT, output_shape)
    constant = np.random.randint((- 127), 127, shape).astype(np.float)
    bias = np.random.randint((- 10), 10, shape[1]).astype(np.float)
    node_const_def = onnx.helper.make_node('Constant', inputs=[], outputs=['const1'], value=helper.make_tensor(name='const_tensor', data_type=TensorProto.FLOAT, dims=constant.shape, vals=constant.flatten()))
    node_def = onnx.helper.make_node('ImageScaler', inputs=['const1'], outputs=['scale'], bias=bias, scale=scale)
    node_concat_def = onnx.helper.make_node('Concat', inputs=['input', 'scale'], outputs=['output'], axis=concat_axis)
    graph_def = helper.make_graph([node_const_def, node_def, node_concat_def], 'test_model', [input], [output])
    onnx_net = helper.make_model(graph_def, producer_name='test_model')
    ir_const = ((constant * scale) + np.expand_dims(np.expand_dims([bias], 2), 3))
    if (precision == 'FP16'):
        ir_const = ir_const.astype(np.float16)
    ref_net = None
    return (onnx_net, ref_net)
ONNX net                                     IR net

Input->Concat(+scaled const)->Output   =>    Input->Concat(+const)
def create_net_const(self, shape, scale, precision, ir_version):
    '\n            ONNX net                                     IR net\n\n            Input->Concat(+scaled const)->Output   =>    Input->Concat(+const)\n\n        '
    import onnx
    from onnx import helper
    from onnx import TensorProto
    concat_axis = 0
    output_shape = shape.copy()
    output_shape[concat_axis] *= 2
    input = helper.make_tensor_value_info('input', TensorProto.FLOAT, shape)
    output = helper.make_tensor_value_info('output', TensorProto.FLOAT, output_shape)
    constant = np.random.randint((- 127), 127, shape).astype(np.float)
    bias = np.random.randint((- 10), 10, shape[1]).astype(np.float)
    node_const_def = onnx.helper.make_node('Constant', inputs=[], outputs=['const1'], value=helper.make_tensor(name='const_tensor', data_type=TensorProto.FLOAT, dims=constant.shape, vals=constant.flatten()))
    node_def = onnx.helper.make_node('ImageScaler', inputs=['const1'], outputs=['scale'], bias=bias, scale=scale)
    node_concat_def = onnx.helper.make_node('Concat', inputs=['input', 'scale'], outputs=['output'], axis=concat_axis)
    graph_def = helper.make_graph([node_const_def, node_def, node_concat_def], 'test_model', [input], [output])
    onnx_net = helper.make_model(graph_def, producer_name='test_model')
    ir_const = ((constant * scale) + np.expand_dims(np.expand_dims([bias], 2), 3))
    if (precision == 'FP16'):
        ir_const = ir_const.astype(np.float16)
    ref_net = None
    return (onnx_net, ref_net)