tools/importers/onnx/lib/onnx_converters.py
def _convertAttributeProto(onnx_arg):  # type: (AttributeProto) -> AttributeValue
        """
        Convert an ONNX AttributeProto into an appropriate Python object
        for the type.
        NB: Tensor attribute gets returned as numpy array
        """
        if onnx_arg.HasField('f'):
            return onnx_arg.f
        elif onnx_arg.HasField('i'):
            return onnx_arg.i
        elif onnx_arg.HasField('s'):
            return onnx_arg.s
        elif onnx_arg.HasField('t'):
            return numpy_helper.to_array(onnx_arg.t)
        elif len(onnx_arg.floats):
            return list(onnx_arg.floats)
        elif len(onnx_arg.ints):
            return list(onnx_arg.ints)
        elif len(onnx_arg.strings):
            return list(onnx_arg.strings)
        else:
            raise ValueError("Unsupported ONNX attribute: {}".format(onnx_arg))

        Convert an ONNX AttributeProto into an appropriate Python object
        for the type.
        NB: Tensor attribute gets returned as numpy array
        
Convert an ONNX AttributeProto into an appropriate Python object
for the type.
NB: Tensor attribute gets returned as numpy array
Convert an ONNX AttributeProto into an appropriate Python object for the type . NB : Tensor attribute gets returned as numpy array
def _convertAttributeProto(onnx_arg):  
        if onnx_arg.HasField('f'):
            return onnx_arg.f
        elif onnx_arg.HasField('i'):
            return onnx_arg.i
        elif onnx_arg.HasField('s'):
            return onnx_arg.s
        elif onnx_arg.HasField('t'):
            return numpy_helper.to_array(onnx_arg.t)
        elif len(onnx_arg.floats):
            return list(onnx_arg.floats)
        elif len(onnx_arg.ints):
            return list(onnx_arg.ints)
        elif len(onnx_arg.strings):
            return list(onnx_arg.strings)
        else:
            raise ValueError("Unsupported ONNX attribute: {}".format(onnx_arg))
def _convertAttributeProto ( onnx_arg ) : if onnx_arg . HasField ( 'f' ) : return onnx_arg . f elif onnx_arg . HasField ( 'i' ) : return onnx_arg . i elif onnx_arg . HasField ( 's' ) : return onnx_arg . s elif onnx_arg . HasField ( 't' ) : return numpy_helper . to_array ( onnx_arg . t ) elif len ( onnx_arg . floats ) : return list ( onnx_arg . floats ) elif len ( onnx_arg . ints ) : return list ( onnx_arg . ints ) elif len ( onnx_arg . strings ) : return list ( onnx_arg . strings ) else : raise ValueError ( "Unsupported ONNX attribute: {}" . format ( onnx_arg ) )
Convert an ONNX AttributeProto into an appropriate Python object
for the type.
Convert an ONNX AttributeProto into an appropriate Python object for the type .
# type: (AttributeProto) -> AttributeValue """
        Convert an ONNX AttributeProto into an appropriate Python object
        for the type.
        NB: Tensor attribute gets returned as numpy array
        """
onnx_arg