def compile_options(h): h.constructor('create') h.method('set_offload_copy', api.params(value='bool'), invoke='migraphx::set_offload_copy($@)') h.method('set_fast_math', api.params(value='bool'), invoke='migraphx::set_fast_math($@)')
def quantize_int8_options(h): h.constructor('create') h.method( 'add_op_name', api.params(name='const char*'), invoke='migraphx::add_op_name($@)', ) h.method( 'add_calibration_data', api.params(data='std::unordered_map<std::string, migraphx::argument>'), invoke='migraphx::add_calibration_data($@)', )
def onnx_options(h): h.constructor('create') h.method( 'set_input_parameter_shape', api.params(name='const char*', dims='std::vector<size_t>'), invoke='migraphx::set_input_parameter_shape($@)', ) h.method( 'set_default_dim_value', api.params(value='size_t'), invoke='migraphx::set_default_dim_value($@)', )
def operation(h): h.constructor('create', api.params(name='const char*', attributes='const char*', vlist='...'), fname='migraphx::create_op') h.method('name', returns='std::string')
def shapes(h): h.method('size', returns='size_t') h.method('get', api.params(idx='size_t'), fname='at', cpp_name='operator[]', returns='const migraphx::shape&')
def shape(h): h.constructor( 'create', api.params(type='migraphx::shape::type_t', lengths='std::vector<size_t>')) h.method('lengths', fname='lens', returns='const std::vector<size_t>&', const=True) h.method('strides', returns='const std::vector<size_t>&', const=True) h.method('type', returns='migraphx::shape::type_t', const=True) h.method('bytes', returns='size_t', const=True) h.method('equal', api.params(x='const migraphx::shape&'), invoke='migraphx::equal($@)', returns='bool', const=True)
def argument(h): h.constructor('create', api.params(shape='const migraphx::shape&', buffer='void*')) h.method('shape', fname='get_shape', cpp_name='get_shape', returns='const migraphx::shape&', const=True) h.method('buffer', fname='data', cpp_name='data', returns='char*', const=True) h.method('equal', api.params(x='const migraphx::argument&'), invoke='migraphx::equal($@)', returns='bool', const=True)
def program_parameter_shapes(h): h.method('size', returns='size_t') h.method('get', api.params(name='const char*'), fname='at', cpp_name='operator[]', returns='const migraphx::shape&') h.method('names', invoke='migraphx::get_names(${program_parameter_shapes})', returns='std::vector<const char*>')
def program(h): h.method( 'compile', api.params(target='migraphx::target', options='migraphx::compile_options')) h.method('get_parameter_shapes', returns='std::unordered_map<std::string, migraphx::shape>') h.method('get_output_shapes', invoke='migraphx::get_output_shapes($@)', returns='std::vector<migraphx::shape>') h.method('print', invoke='migraphx::print($@)', const=True) h.method('run', api.params( params='std::unordered_map<std::string, migraphx::argument>'), invoke='migraphx::run($@)', returns='std::vector<migraphx::argument>') h.method('equal', api.params(x='const migraphx::program&'), invoke='migraphx::equal($@)', returns='bool', const=True)
def tf_options(h): h.constructor('create') h.method( 'set_nhwc', api.params(is_nhwc='bool'), invoke='migraphx::set_nhwc($@)', ) h.method( 'set_input_parameter_shape', api.params(name='const char*', dims='std::vector<size_t>'), invoke='migraphx::set_input_parameter_shape($@)', ) h.method( 'set_default_dim_value', api.params(value='size_t'), invoke='migraphx::set_default_dim_value($@)', ) h.method( 'set_output_names', api.params(names='std::vector<const char*>'), invoke='migraphx::set_output_names($@)', )
def quantize_op_names(h): h.constructor('create') h.method('add', api.params(name='const char*'), fname='push_back')
def file_options(h): h.constructor('create') h.method('set_file_format', api.params(format='const char*'), invoke='migraphx::set_file_format($@)')
def program_parameters(h): h.constructor('create') h.method('add', api.params(name='const char*', argument='const migraphx::argument&'), invoke='${program_parameters}[${name}] = ${argument}')
def target(h): h.constructor('create', api.params(name='const char*'), fname='migraphx::get_target')
returns='const migraphx::shape&', const=True) h.method('buffer', fname='data', cpp_name='data', returns='char*', const=True) h.method('equal', api.params(x='const migraphx::argument&'), invoke='migraphx::equal($@)', returns='bool', const=True) api.add_function('migraphx_argument_generate', api.params(s='const migraphx::shape&', seed='size_t'), fname='migraphx::generate_argument', returns='migraphx::argument') @auto_handle() def target(h): h.constructor('create', api.params(name='const char*'), fname='migraphx::get_target') @api.handle('migraphx_program_parameter_shapes', 'std::unordered_map<std::string, migraphx::shape>') def program_parameter_shapes(h): h.method('size', returns='size_t')
returns='const migraphx::shape&', const=True) h.method('buffer', fname='data', cpp_name='data', returns='char*', const=True) h.method('equal', api.params(x='const migraphx::argument&'), invoke='migraphx::equal($@)', returns='bool', const=True) api.add_function('migraphx_argument_generate', api.params(s='const migraphx::shape&', seed='size_t'), fname='migraphx::generate_argument', returns='migraphx::argument') @auto_handle def target(h): h.constructor('create', api.params(name='const char*'), fname='migraphx::get_target') @api.handle('migraphx_program_parameter_shapes', 'std::unordered_map<std::string, migraphx::shape>') def program_parameter_shapes(h): h.method('size', returns='size_t')