function longToNumber(i, type) {
    // INT64, UINT32, UINT64
    if (type === onnx_proto_1.onnx.TensorProto.DataType.INT64 || type === ortFbs.TensorDataType.INT64) {
        if (i.greaterThanOrEqual(2147483648) || i.lessThan(-2147483648)) {
            throw new TypeError('int64 is not supported');
        }
    }
    else if (type === onnx_proto_1.onnx.TensorProto.DataType.UINT32 || type === ortFbs.TensorDataType.UINT32 ||
        type === onnx_proto_1.onnx.TensorProto.DataType.UINT64 || type === ortFbs.TensorDataType.UINT64) {
        if (i.greaterThanOrEqual(4294967296) || i.lessThan(0)) {
            throw new TypeError('uint64 is not supported');
        }
    }
    else {
        throw new TypeError(`not a LONG type: ${onnx_proto_1.onnx.TensorProto.DataType[type]}`);
    }
    return i.toNumber();
}
// convert a long number to a 32-bit integer (cast-down)
convert a long number to a 32-bit integer (cast-down)
convert a long number to a 32 - bit integer ( cast - down )
function longToNumber(i, type) {
    if (type === onnx_proto_1.onnx.TensorProto.DataType.INT64 || type === ortFbs.TensorDataType.INT64) {
        if (i.greaterThanOrEqual(2147483648) || i.lessThan(-2147483648)) {
            throw new TypeError('int64 is not supported');
        }
    }
    else if (type === onnx_proto_1.onnx.TensorProto.DataType.UINT32 || type === ortFbs.TensorDataType.UINT32 ||
        type === onnx_proto_1.onnx.TensorProto.DataType.UINT64 || type === ortFbs.TensorDataType.UINT64) {
        if (i.greaterThanOrEqual(4294967296) || i.lessThan(0)) {
            throw new TypeError('uint64 is not supported');
        }
    }
    else {
        throw new TypeError(`not a LONG type: ${onnx_proto_1.onnx.TensorProto.DataType[type]}`);
    }
    return i.toNumber();
}
function longToNumber ( i , type ) { if ( type === onnx_proto_1 . onnx . TensorProto . DataType . INT64 || type === ortFbs . TensorDataType . INT64 ) { if ( i . greaterThanOrEqual ( 2147483648 ) || i . lessThan ( - 2147483648 ) ) { throw new TypeError ( 'int64 is not supported' ) ; } } else if ( type === onnx_proto_1 . onnx . TensorProto . DataType . UINT32 || type === ortFbs . TensorDataType . UINT32 || type === onnx_proto_1 . onnx . TensorProto . DataType . UINT64 || type === ortFbs . TensorDataType . UINT64 ) { if ( i . greaterThanOrEqual ( 4294967296 ) || i . lessThan ( 0 ) ) { throw new TypeError ( 'uint64 is not supported' ) ; } } else { throw new TypeError ( ` ${ onnx_proto_1 . onnx . TensorProto . DataType [ type ] } ` ) ; } return i . toNumber ( ) ; }
convert a long number to a 32-bit integer (cast-down)
convert a long number to a 32 - bit integer ( cast - down )
// INT64, UINT32, UINT64