(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):  # 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:
        return None
def _convertAttributeProto ( onnx_arg ) : # type: (AttributeProto) -> AttributeValue 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 : return None