How to use the onnxruntime.capi.onnxruntime_pybind11_state.schemadef.OpSchema function in onnxruntime

To help you get started, we’ve selected a few onnxruntime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / onnxruntime / tools / python / gen_doc.py View on Github external
def display_number(v):  # type: (int) -> Text
    if OpSchema.is_infinite(v):
        return '∞'
    return Text(v)
github microsoft / onnxruntime / tools / python / gen_doc.py View on Github external
def support_level_str(level):  # type: (OpSchema.SupportType) -> Text
    return \
        "<sub>experimental</sub> " if level == OpSchema.SupportType.EXPERIMENTAL else ""
github microsoft / onnxruntime / tools / python / gen_doc.py View on Github external
s += '\n'

    # outputs
    s += '\n#### Outputs'
    if schema.min_output != schema.max_output:
        s += ' ({} - {})'.format(display_number(schema.min_output),
                                 display_number(schema.max_output))
    s += '\n\n'
    outputs = schema.outputs
    if outputs:
        s += '<dl>\n'
        for output in outputs:
            option_str = ""
            if OpSchema.FormalParameterOption.Optional == output.option:
                option_str = " (optional)"
            elif OpSchema.FormalParameterOption.Variadic == output.option:
                if output.isHomogeneous:
                    option_str = " (variadic)"
                else:
                    option_str = " (variadic, heterogeneous)"
            s += '<dt><tt>{}</tt>{} : {}</dt>\n'.format(output.name, option_str, output.typeStr)
            s += '<dd>{}</dd>\n'.format(output.description)

    s += '</dl>\n'

    # type constraints
    s += '\n#### Type Constraints'
    s += '\n\n'
    typecons = schema.type_constraints
    if typecons:
        s += '<dl>\n'
        for type_constraint in typecons:</dl>
github microsoft / onnxruntime / tools / python / gen_doc.py View on Github external
def display_attr_type(v):  # type: (OpSchema.AttrType) -> Text
    assert isinstance(v, OpSchema.AttrType)
    s = Text(v)
    s = s[s.rfind('.') + 1:].lower()
    if s[-1] == 's':
        s = 'list of ' + s
    return s