| |
|
|
|
|
| #ifndef FLATBUFFERS_GENERATED_MPSSCHEMA_MPSGRAPH_H_ |
| #define FLATBUFFERS_GENERATED_MPSSCHEMA_MPSGRAPH_H_ |
|
|
| #include "flatbuffers/flatbuffers.h" |
|
|
| |
| |
| static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && |
| FLATBUFFERS_VERSION_MINOR == 3 && |
| FLATBUFFERS_VERSION_REVISION == 25, |
| "Non-compatible flatbuffers version included"); |
|
|
| namespace mpsgraph { |
|
|
| struct _MPSNode1x1; |
| struct _MPSNode1x1Builder; |
|
|
| struct _MPSNode2x1; |
| struct _MPSNode2x1Builder; |
|
|
| struct _MPSDivNode2x1; |
| struct _MPSDivNode2x1Builder; |
|
|
| struct _MPSNodeWithAlpha2x1; |
| struct _MPSNodeWithAlpha2x1Builder; |
|
|
| struct _MPSNode3x1; |
| struct _MPSNode3x1Builder; |
|
|
| struct MPSMinMax; |
| struct MPSMinMaxBuilder; |
|
|
| struct MPSPooling2D; |
| struct MPSPooling2DBuilder; |
|
|
| struct MPSHardTanh; |
| struct MPSHardTanhBuilder; |
|
|
| struct MPSGELU; |
| struct MPSGELUBuilder; |
|
|
| struct MPSLeakyReLU; |
| struct MPSLeakyReLUBuilder; |
|
|
| struct MPSSoftmax; |
| struct MPSSoftmaxBuilder; |
|
|
| struct MPSClamp; |
| struct MPSClampBuilder; |
|
|
| struct MPSMean; |
| struct MPSMeanBuilder; |
|
|
| struct MPSIndexSelect; |
| struct MPSIndexSelectBuilder; |
|
|
| struct MPSEmbedding; |
| struct MPSEmbeddingBuilder; |
|
|
| struct MPSIndexTensor; |
| struct MPSIndexTensorBuilder; |
|
|
| struct MPSIndexPut; |
| struct MPSIndexPutBuilder; |
|
|
| struct MPSScatter; |
| struct MPSScatterBuilder; |
|
|
| struct MPSPermute; |
| struct MPSPermuteBuilder; |
|
|
| struct MPSView; |
| struct MPSViewBuilder; |
|
|
| struct MPSCat; |
| struct MPSCatBuilder; |
|
|
| struct MPSSqueeze; |
| struct MPSSqueezeBuilder; |
|
|
| struct MPSUnsqueeze; |
| struct MPSUnsqueezeBuilder; |
|
|
| struct MPSSelect; |
| struct MPSSelectBuilder; |
|
|
| struct MPSSlice; |
| struct MPSSliceBuilder; |
|
|
| struct MPSPixelShuffle; |
| struct MPSPixelShuffleBuilder; |
|
|
| struct MPSSplitWithSizes; |
| struct MPSSplitWithSizesBuilder; |
|
|
| struct MPSCast; |
| struct MPSCastBuilder; |
|
|
| struct MPSAddmm; |
| struct MPSAddmmBuilder; |
|
|
| struct _MPSFull; |
| struct _MPSFullBuilder; |
|
|
| struct MPSConv; |
| struct MPSConvBuilder; |
|
|
| struct MPSBatchNorm; |
| struct MPSBatchNormBuilder; |
|
|
| struct MPSLayerNorm; |
| struct MPSLayerNormBuilder; |
|
|
| struct MPSConstantPadND; |
| struct MPSConstantPadNDBuilder; |
|
|
| struct MPSArange; |
| struct MPSArangeBuilder; |
|
|
| struct MPSDequantizePerChannelGroup; |
| struct MPSDequantizePerChannelGroupBuilder; |
|
|
| struct MPSNode; |
| struct MPSNodeBuilder; |
|
|
| struct Buffer; |
| struct BufferBuilder; |
|
|
| struct MPSTensor; |
| struct MPSTensorBuilder; |
|
|
| struct DataSegment; |
| struct DataSegmentBuilder; |
|
|
| struct MPSGraph; |
| struct MPSGraphBuilder; |
|
|
| enum MPSDataType : int16_t { |
| MPSDataType_mps_data_type_invalid = 0, |
| MPSDataType_mps_data_type_float16 = 1, |
| MPSDataType_mps_data_type_float32 = 2, |
| MPSDataType_mps_data_type_float64 = 3, |
| MPSDataType_mps_data_type_bfloat16 = 4, |
| MPSDataType_mps_data_type_int4 = 5, |
| MPSDataType_mps_data_type_int8 = 6, |
| MPSDataType_mps_data_type_int16 = 7, |
| MPSDataType_mps_data_type_int32 = 8, |
| MPSDataType_mps_data_type_int64 = 9, |
| MPSDataType_mps_data_type_uint4 = 10, |
| MPSDataType_mps_data_type_uint8 = 11, |
| MPSDataType_mps_data_type_uint16 = 12, |
| MPSDataType_mps_data_type_uint32 = 13, |
| MPSDataType_mps_data_type_uint64 = 14, |
| MPSDataType_mps_data_type_bool = 15, |
| MPSDataType_mps_data_type_complex_float16 = 16, |
| MPSDataType_mps_data_type_complex_float32 = 17, |
| MPSDataType_MIN = MPSDataType_mps_data_type_invalid, |
| MPSDataType_MAX = MPSDataType_mps_data_type_complex_float32 |
| }; |
|
|
| inline const MPSDataType (&EnumValuesMPSDataType())[18] { |
| static const MPSDataType values[] = { |
| MPSDataType_mps_data_type_invalid, |
| MPSDataType_mps_data_type_float16, |
| MPSDataType_mps_data_type_float32, |
| MPSDataType_mps_data_type_float64, |
| MPSDataType_mps_data_type_bfloat16, |
| MPSDataType_mps_data_type_int4, |
| MPSDataType_mps_data_type_int8, |
| MPSDataType_mps_data_type_int16, |
| MPSDataType_mps_data_type_int32, |
| MPSDataType_mps_data_type_int64, |
| MPSDataType_mps_data_type_uint4, |
| MPSDataType_mps_data_type_uint8, |
| MPSDataType_mps_data_type_uint16, |
| MPSDataType_mps_data_type_uint32, |
| MPSDataType_mps_data_type_uint64, |
| MPSDataType_mps_data_type_bool, |
| MPSDataType_mps_data_type_complex_float16, |
| MPSDataType_mps_data_type_complex_float32 |
| }; |
| return values; |
| } |
|
|
| inline const char * const *EnumNamesMPSDataType() { |
| static const char * const names[19] = { |
| "mps_data_type_invalid", |
| "mps_data_type_float16", |
| "mps_data_type_float32", |
| "mps_data_type_float64", |
| "mps_data_type_bfloat16", |
| "mps_data_type_int4", |
| "mps_data_type_int8", |
| "mps_data_type_int16", |
| "mps_data_type_int32", |
| "mps_data_type_int64", |
| "mps_data_type_uint4", |
| "mps_data_type_uint8", |
| "mps_data_type_uint16", |
| "mps_data_type_uint32", |
| "mps_data_type_uint64", |
| "mps_data_type_bool", |
| "mps_data_type_complex_float16", |
| "mps_data_type_complex_float32", |
| nullptr |
| }; |
| return names; |
| } |
|
|
| inline const char *EnumNameMPSDataType(MPSDataType e) { |
| if (::flatbuffers::IsOutRange(e, MPSDataType_mps_data_type_invalid, MPSDataType_mps_data_type_complex_float32)) return ""; |
| const size_t index = static_cast<size_t>(e); |
| return EnumNamesMPSDataType()[index]; |
| } |
|
|
| enum OpType : int16_t { |
| OpType_mps_graph = 0, |
| OpType_metal_kernel = 1, |
| OpType_MIN = OpType_mps_graph, |
| OpType_MAX = OpType_metal_kernel |
| }; |
|
|
| inline const OpType (&EnumValuesOpType())[2] { |
| static const OpType values[] = { |
| OpType_mps_graph, |
| OpType_metal_kernel |
| }; |
| return values; |
| } |
|
|
| inline const char * const *EnumNamesOpType() { |
| static const char * const names[3] = { |
| "mps_graph", |
| "metal_kernel", |
| nullptr |
| }; |
| return names; |
| } |
|
|
| inline const char *EnumNameOpType(OpType e) { |
| if (::flatbuffers::IsOutRange(e, OpType_mps_graph, OpType_metal_kernel)) return ""; |
| const size_t index = static_cast<size_t>(e); |
| return EnumNamesOpType()[index]; |
| } |
|
|
| enum MPSNodeUnion : uint8_t { |
| MPSNodeUnion_NONE = 0, |
| MPSNodeUnion_MPSHardTanh = 1, |
| MPSNodeUnion_MPSReLU = 2, |
| MPSNodeUnion_MPSGELU = 3, |
| MPSNodeUnion_MPSLeakyReLU = 4, |
| MPSNodeUnion_MPSSoftmax = 5, |
| MPSNodeUnion_MPSLogSoftmax = 6, |
| MPSNodeUnion_MPSAdd = 7, |
| MPSNodeUnion_MPSSub = 8, |
| MPSNodeUnion_MPSMul = 9, |
| MPSNodeUnion_MPSDiv = 10, |
| MPSNodeUnion_MPSFmod = 11, |
| MPSNodeUnion_MPSRemainder = 12, |
| MPSNodeUnion_MPSMin = 13, |
| MPSNodeUnion_MPSMax = 14, |
| MPSNodeUnion_MPSPow = 15, |
| MPSNodeUnion_MPSAtan2 = 16, |
| MPSNodeUnion_MPSBitwiseAnd = 17, |
| MPSNodeUnion_MPSBitwiseOr = 18, |
| MPSNodeUnion_MPSBitwiseXor = 19, |
| MPSNodeUnion_MPSMinimum = 20, |
| MPSNodeUnion_MPSExp = 21, |
| MPSNodeUnion_MPSExp2 = 22, |
| MPSNodeUnion_MPSReciprocal = 23, |
| MPSNodeUnion_MPSSqrt = 24, |
| MPSNodeUnion_MPSNeg = 25, |
| MPSNodeUnion_MPSLog = 26, |
| MPSNodeUnion_MPSLog10 = 27, |
| MPSNodeUnion_MPSLog2 = 28, |
| MPSNodeUnion_MPSErf = 29, |
| MPSNodeUnion_MPSFloor = 30, |
| MPSNodeUnion_MPSCeil = 31, |
| MPSNodeUnion_MPSRsqrt = 32, |
| MPSNodeUnion_MPSSigmoid = 33, |
| MPSNodeUnion_MPSSin = 34, |
| MPSNodeUnion_MPSSign = 35, |
| MPSNodeUnion_MPSCos = 36, |
| MPSNodeUnion_MPSTan = 37, |
| MPSNodeUnion_MPSAbs = 38, |
| MPSNodeUnion_MPSAsin = 39, |
| MPSNodeUnion_MPSAcos = 40, |
| MPSNodeUnion_MPSAtan = 41, |
| MPSNodeUnion_MPSSinh = 42, |
| MPSNodeUnion_MPSCosh = 43, |
| MPSNodeUnion_MPSTanh = 44, |
| MPSNodeUnion_MPSAsinh = 45, |
| MPSNodeUnion_MPSAcosh = 46, |
| MPSNodeUnion_MPSAtanh = 47, |
| MPSNodeUnion_MPSBitwiseNot = 48, |
| MPSNodeUnion_MPSIsnan = 49, |
| MPSNodeUnion_MPSIsinf = 50, |
| MPSNodeUnion_MPSRound = 51, |
| MPSNodeUnion_MPSLogicalNot = 52, |
| MPSNodeUnion_MPSMatMul = 53, |
| MPSNodeUnion_MPSAddmm = 54, |
| MPSNodeUnion_MPSFull = 55, |
| MPSNodeUnion_MPSFullLike = 56, |
| MPSNodeUnion_MPSClamp = 57, |
| MPSNodeUnion_MPSWhere = 58, |
| MPSNodeUnion_MPSIndexSelect = 59, |
| MPSNodeUnion_MPSEmbedding = 60, |
| MPSNodeUnion_MPSIndexTensor = 61, |
| MPSNodeUnion_MPSIndexPut = 62, |
| MPSNodeUnion_MPSScatter = 63, |
| MPSNodeUnion_MPSMean = 64, |
| MPSNodeUnion_MPSPermute = 65, |
| MPSNodeUnion_MPSView = 66, |
| MPSNodeUnion_MPSExpand = 67, |
| MPSNodeUnion_MPSCat = 68, |
| MPSNodeUnion_MPSSqueeze = 69, |
| MPSNodeUnion_MPSUnsqueeze = 70, |
| MPSNodeUnion_MPSSelect = 71, |
| MPSNodeUnion_MPSSlice = 72, |
| MPSNodeUnion_MPSPixelShuffle = 73, |
| MPSNodeUnion_MPSSplitWithSizes = 74, |
| MPSNodeUnion_MPSCast = 75, |
| MPSNodeUnion_MPSConv2D = 76, |
| MPSNodeUnion_MPSDepthwiseConv2D = 77, |
| MPSNodeUnion_MPSEq = 78, |
| MPSNodeUnion_MPSNe = 79, |
| MPSNodeUnion_MPSGe = 80, |
| MPSNodeUnion_MPSGt = 81, |
| MPSNodeUnion_MPSLe = 82, |
| MPSNodeUnion_MPSLt = 83, |
| MPSNodeUnion_MPSBatchNorm = 84, |
| MPSNodeUnion_MPSLayerNorm = 85, |
| MPSNodeUnion_MPSMaxPool2DWithIndices = 86, |
| MPSNodeUnion_MPSAvgPool2D = 87, |
| MPSNodeUnion_MPSConstantPadND = 88, |
| MPSNodeUnion_MPSArange = 89, |
| MPSNodeUnion_MPSDequantizePerChannelGroup = 90, |
| MPSNodeUnion_MIN = MPSNodeUnion_NONE, |
| MPSNodeUnion_MAX = MPSNodeUnion_MPSDequantizePerChannelGroup |
| }; |
|
|
| inline const MPSNodeUnion (&EnumValuesMPSNodeUnion())[91] { |
| static const MPSNodeUnion values[] = { |
| MPSNodeUnion_NONE, |
| MPSNodeUnion_MPSHardTanh, |
| MPSNodeUnion_MPSReLU, |
| MPSNodeUnion_MPSGELU, |
| MPSNodeUnion_MPSLeakyReLU, |
| MPSNodeUnion_MPSSoftmax, |
| MPSNodeUnion_MPSLogSoftmax, |
| MPSNodeUnion_MPSAdd, |
| MPSNodeUnion_MPSSub, |
| MPSNodeUnion_MPSMul, |
| MPSNodeUnion_MPSDiv, |
| MPSNodeUnion_MPSFmod, |
| MPSNodeUnion_MPSRemainder, |
| MPSNodeUnion_MPSMin, |
| MPSNodeUnion_MPSMax, |
| MPSNodeUnion_MPSPow, |
| MPSNodeUnion_MPSAtan2, |
| MPSNodeUnion_MPSBitwiseAnd, |
| MPSNodeUnion_MPSBitwiseOr, |
| MPSNodeUnion_MPSBitwiseXor, |
| MPSNodeUnion_MPSMinimum, |
| MPSNodeUnion_MPSExp, |
| MPSNodeUnion_MPSExp2, |
| MPSNodeUnion_MPSReciprocal, |
| MPSNodeUnion_MPSSqrt, |
| MPSNodeUnion_MPSNeg, |
| MPSNodeUnion_MPSLog, |
| MPSNodeUnion_MPSLog10, |
| MPSNodeUnion_MPSLog2, |
| MPSNodeUnion_MPSErf, |
| MPSNodeUnion_MPSFloor, |
| MPSNodeUnion_MPSCeil, |
| MPSNodeUnion_MPSRsqrt, |
| MPSNodeUnion_MPSSigmoid, |
| MPSNodeUnion_MPSSin, |
| MPSNodeUnion_MPSSign, |
| MPSNodeUnion_MPSCos, |
| MPSNodeUnion_MPSTan, |
| MPSNodeUnion_MPSAbs, |
| MPSNodeUnion_MPSAsin, |
| MPSNodeUnion_MPSAcos, |
| MPSNodeUnion_MPSAtan, |
| MPSNodeUnion_MPSSinh, |
| MPSNodeUnion_MPSCosh, |
| MPSNodeUnion_MPSTanh, |
| MPSNodeUnion_MPSAsinh, |
| MPSNodeUnion_MPSAcosh, |
| MPSNodeUnion_MPSAtanh, |
| MPSNodeUnion_MPSBitwiseNot, |
| MPSNodeUnion_MPSIsnan, |
| MPSNodeUnion_MPSIsinf, |
| MPSNodeUnion_MPSRound, |
| MPSNodeUnion_MPSLogicalNot, |
| MPSNodeUnion_MPSMatMul, |
| MPSNodeUnion_MPSAddmm, |
| MPSNodeUnion_MPSFull, |
| MPSNodeUnion_MPSFullLike, |
| MPSNodeUnion_MPSClamp, |
| MPSNodeUnion_MPSWhere, |
| MPSNodeUnion_MPSIndexSelect, |
| MPSNodeUnion_MPSEmbedding, |
| MPSNodeUnion_MPSIndexTensor, |
| MPSNodeUnion_MPSIndexPut, |
| MPSNodeUnion_MPSScatter, |
| MPSNodeUnion_MPSMean, |
| MPSNodeUnion_MPSPermute, |
| MPSNodeUnion_MPSView, |
| MPSNodeUnion_MPSExpand, |
| MPSNodeUnion_MPSCat, |
| MPSNodeUnion_MPSSqueeze, |
| MPSNodeUnion_MPSUnsqueeze, |
| MPSNodeUnion_MPSSelect, |
| MPSNodeUnion_MPSSlice, |
| MPSNodeUnion_MPSPixelShuffle, |
| MPSNodeUnion_MPSSplitWithSizes, |
| MPSNodeUnion_MPSCast, |
| MPSNodeUnion_MPSConv2D, |
| MPSNodeUnion_MPSDepthwiseConv2D, |
| MPSNodeUnion_MPSEq, |
| MPSNodeUnion_MPSNe, |
| MPSNodeUnion_MPSGe, |
| MPSNodeUnion_MPSGt, |
| MPSNodeUnion_MPSLe, |
| MPSNodeUnion_MPSLt, |
| MPSNodeUnion_MPSBatchNorm, |
| MPSNodeUnion_MPSLayerNorm, |
| MPSNodeUnion_MPSMaxPool2DWithIndices, |
| MPSNodeUnion_MPSAvgPool2D, |
| MPSNodeUnion_MPSConstantPadND, |
| MPSNodeUnion_MPSArange, |
| MPSNodeUnion_MPSDequantizePerChannelGroup |
| }; |
| return values; |
| } |
|
|
| inline const char * const *EnumNamesMPSNodeUnion() { |
| static const char * const names[92] = { |
| "NONE", |
| "MPSHardTanh", |
| "MPSReLU", |
| "MPSGELU", |
| "MPSLeakyReLU", |
| "MPSSoftmax", |
| "MPSLogSoftmax", |
| "MPSAdd", |
| "MPSSub", |
| "MPSMul", |
| "MPSDiv", |
| "MPSFmod", |
| "MPSRemainder", |
| "MPSMin", |
| "MPSMax", |
| "MPSPow", |
| "MPSAtan2", |
| "MPSBitwiseAnd", |
| "MPSBitwiseOr", |
| "MPSBitwiseXor", |
| "MPSMinimum", |
| "MPSExp", |
| "MPSExp2", |
| "MPSReciprocal", |
| "MPSSqrt", |
| "MPSNeg", |
| "MPSLog", |
| "MPSLog10", |
| "MPSLog2", |
| "MPSErf", |
| "MPSFloor", |
| "MPSCeil", |
| "MPSRsqrt", |
| "MPSSigmoid", |
| "MPSSin", |
| "MPSSign", |
| "MPSCos", |
| "MPSTan", |
| "MPSAbs", |
| "MPSAsin", |
| "MPSAcos", |
| "MPSAtan", |
| "MPSSinh", |
| "MPSCosh", |
| "MPSTanh", |
| "MPSAsinh", |
| "MPSAcosh", |
| "MPSAtanh", |
| "MPSBitwiseNot", |
| "MPSIsnan", |
| "MPSIsinf", |
| "MPSRound", |
| "MPSLogicalNot", |
| "MPSMatMul", |
| "MPSAddmm", |
| "MPSFull", |
| "MPSFullLike", |
| "MPSClamp", |
| "MPSWhere", |
| "MPSIndexSelect", |
| "MPSEmbedding", |
| "MPSIndexTensor", |
| "MPSIndexPut", |
| "MPSScatter", |
| "MPSMean", |
| "MPSPermute", |
| "MPSView", |
| "MPSExpand", |
| "MPSCat", |
| "MPSSqueeze", |
| "MPSUnsqueeze", |
| "MPSSelect", |
| "MPSSlice", |
| "MPSPixelShuffle", |
| "MPSSplitWithSizes", |
| "MPSCast", |
| "MPSConv2D", |
| "MPSDepthwiseConv2D", |
| "MPSEq", |
| "MPSNe", |
| "MPSGe", |
| "MPSGt", |
| "MPSLe", |
| "MPSLt", |
| "MPSBatchNorm", |
| "MPSLayerNorm", |
| "MPSMaxPool2DWithIndices", |
| "MPSAvgPool2D", |
| "MPSConstantPadND", |
| "MPSArange", |
| "MPSDequantizePerChannelGroup", |
| nullptr |
| }; |
| return names; |
| } |
|
|
| inline const char *EnumNameMPSNodeUnion(MPSNodeUnion e) { |
| if (::flatbuffers::IsOutRange(e, MPSNodeUnion_NONE, MPSNodeUnion_MPSDequantizePerChannelGroup)) return ""; |
| const size_t index = static_cast<size_t>(e); |
| return EnumNamesMPSNodeUnion()[index]; |
| } |
|
|
| bool VerifyMPSNodeUnion(::flatbuffers::Verifier &verifier, const void *obj, MPSNodeUnion type); |
| bool VerifyMPSNodeUnionVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset<void>> *values, const ::flatbuffers::Vector<uint8_t> *types); |
|
|
| struct _MPSNode1x1 FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef _MPSNode1x1Builder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct _MPSNode1x1Builder { |
| typedef _MPSNode1x1 Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(_MPSNode1x1::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(_MPSNode1x1::VT_OUTPUT_ID, output_id, 0); |
| } |
| explicit _MPSNode1x1Builder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<_MPSNode1x1> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<_MPSNode1x1>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<_MPSNode1x1> Create_MPSNode1x1( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0) { |
| _MPSNode1x1Builder builder_(_fbb); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| struct _MPSNode2x1 FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef _MPSNode2x1Builder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_INPUT2_ID = 6, |
| VT_OUTPUT_ID = 8 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t input2_id() const { |
| return GetField<int32_t>(VT_INPUT2_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_INPUT2_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct _MPSNode2x1Builder { |
| typedef _MPSNode2x1 Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(_MPSNode2x1::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_input2_id(int32_t input2_id) { |
| fbb_.AddElement<int32_t>(_MPSNode2x1::VT_INPUT2_ID, input2_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(_MPSNode2x1::VT_OUTPUT_ID, output_id, 0); |
| } |
| explicit _MPSNode2x1Builder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<_MPSNode2x1> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<_MPSNode2x1>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<_MPSNode2x1> Create_MPSNode2x1( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t input2_id = 0, |
| int32_t output_id = 0) { |
| _MPSNode2x1Builder builder_(_fbb); |
| builder_.add_output_id(output_id); |
| builder_.add_input2_id(input2_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| struct _MPSDivNode2x1 FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef _MPSDivNode2x1Builder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_INPUT2_ID = 6, |
| VT_OUTPUT_ID = 8, |
| VT_ROUNDING_MODE = 10 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t input2_id() const { |
| return GetField<int32_t>(VT_INPUT2_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| const ::flatbuffers::String *rounding_mode() const { |
| return GetPointer<const ::flatbuffers::String *>(VT_ROUNDING_MODE); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_INPUT2_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyOffset(verifier, VT_ROUNDING_MODE) && |
| verifier.VerifyString(rounding_mode()) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct _MPSDivNode2x1Builder { |
| typedef _MPSDivNode2x1 Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(_MPSDivNode2x1::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_input2_id(int32_t input2_id) { |
| fbb_.AddElement<int32_t>(_MPSDivNode2x1::VT_INPUT2_ID, input2_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(_MPSDivNode2x1::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_rounding_mode(::flatbuffers::Offset<::flatbuffers::String> rounding_mode) { |
| fbb_.AddOffset(_MPSDivNode2x1::VT_ROUNDING_MODE, rounding_mode); |
| } |
| explicit _MPSDivNode2x1Builder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<_MPSDivNode2x1> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<_MPSDivNode2x1>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<_MPSDivNode2x1> Create_MPSDivNode2x1( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t input2_id = 0, |
| int32_t output_id = 0, |
| ::flatbuffers::Offset<::flatbuffers::String> rounding_mode = 0) { |
| _MPSDivNode2x1Builder builder_(_fbb); |
| builder_.add_rounding_mode(rounding_mode); |
| builder_.add_output_id(output_id); |
| builder_.add_input2_id(input2_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<_MPSDivNode2x1> Create_MPSDivNode2x1Direct( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t input2_id = 0, |
| int32_t output_id = 0, |
| const char *rounding_mode = nullptr) { |
| auto rounding_mode__ = rounding_mode ? _fbb.CreateString(rounding_mode) : 0; |
| return mpsgraph::Create_MPSDivNode2x1( |
| _fbb, |
| input1_id, |
| input2_id, |
| output_id, |
| rounding_mode__); |
| } |
|
|
| struct _MPSNodeWithAlpha2x1 FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef _MPSNodeWithAlpha2x1Builder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_INPUT2_ID = 6, |
| VT_OUTPUT_ID = 8, |
| VT_ALPHA = 10 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t input2_id() const { |
| return GetField<int32_t>(VT_INPUT2_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| float alpha() const { |
| return GetField<float>(VT_ALPHA, 0.0f); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_INPUT2_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<float>(verifier, VT_ALPHA, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct _MPSNodeWithAlpha2x1Builder { |
| typedef _MPSNodeWithAlpha2x1 Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(_MPSNodeWithAlpha2x1::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_input2_id(int32_t input2_id) { |
| fbb_.AddElement<int32_t>(_MPSNodeWithAlpha2x1::VT_INPUT2_ID, input2_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(_MPSNodeWithAlpha2x1::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_alpha(float alpha) { |
| fbb_.AddElement<float>(_MPSNodeWithAlpha2x1::VT_ALPHA, alpha, 0.0f); |
| } |
| explicit _MPSNodeWithAlpha2x1Builder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<_MPSNodeWithAlpha2x1> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<_MPSNodeWithAlpha2x1>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<_MPSNodeWithAlpha2x1> Create_MPSNodeWithAlpha2x1( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t input2_id = 0, |
| int32_t output_id = 0, |
| float alpha = 0.0f) { |
| _MPSNodeWithAlpha2x1Builder builder_(_fbb); |
| builder_.add_alpha(alpha); |
| builder_.add_output_id(output_id); |
| builder_.add_input2_id(input2_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| struct _MPSNode3x1 FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef _MPSNode3x1Builder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_INPUT2_ID = 6, |
| VT_INPUT3_ID = 8, |
| VT_OUTPUT_ID = 10 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t input2_id() const { |
| return GetField<int32_t>(VT_INPUT2_ID, 0); |
| } |
| int32_t input3_id() const { |
| return GetField<int32_t>(VT_INPUT3_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_INPUT2_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_INPUT3_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct _MPSNode3x1Builder { |
| typedef _MPSNode3x1 Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(_MPSNode3x1::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_input2_id(int32_t input2_id) { |
| fbb_.AddElement<int32_t>(_MPSNode3x1::VT_INPUT2_ID, input2_id, 0); |
| } |
| void add_input3_id(int32_t input3_id) { |
| fbb_.AddElement<int32_t>(_MPSNode3x1::VT_INPUT3_ID, input3_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(_MPSNode3x1::VT_OUTPUT_ID, output_id, 0); |
| } |
| explicit _MPSNode3x1Builder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<_MPSNode3x1> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<_MPSNode3x1>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<_MPSNode3x1> Create_MPSNode3x1( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t input2_id = 0, |
| int32_t input3_id = 0, |
| int32_t output_id = 0) { |
| _MPSNode3x1Builder builder_(_fbb); |
| builder_.add_output_id(output_id); |
| builder_.add_input3_id(input3_id); |
| builder_.add_input2_id(input2_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSMinMax FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSMinMaxBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_MIN_VALUE = 4, |
| VT_MAX_VALUE = 6 |
| }; |
| float min_value() const { |
| return GetField<float>(VT_MIN_VALUE, 0.0f); |
| } |
| float max_value() const { |
| return GetField<float>(VT_MAX_VALUE, 0.0f); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<float>(verifier, VT_MIN_VALUE, 4) && |
| VerifyField<float>(verifier, VT_MAX_VALUE, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSMinMaxBuilder { |
| typedef MPSMinMax Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_min_value(float min_value) { |
| fbb_.AddElement<float>(MPSMinMax::VT_MIN_VALUE, min_value, 0.0f); |
| } |
| void add_max_value(float max_value) { |
| fbb_.AddElement<float>(MPSMinMax::VT_MAX_VALUE, max_value, 0.0f); |
| } |
| explicit MPSMinMaxBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSMinMax> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSMinMax>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSMinMax> CreateMPSMinMax( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| float min_value = 0.0f, |
| float max_value = 0.0f) { |
| MPSMinMaxBuilder builder_(_fbb); |
| builder_.add_max_value(max_value); |
| builder_.add_min_value(min_value); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSPooling2D FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSPooling2DBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_KERNEL_HEIGHT = 6, |
| VT_KERNEL_WIDTH = 8, |
| VT_STRIDE_HEIGHT = 10, |
| VT_STRIDE_WIDTH = 12, |
| VT_PADDING_LEFT = 14, |
| VT_PADDING_RIGHT = 16, |
| VT_PADDING_TOP = 18, |
| VT_PADDING_BOTTOM = 20, |
| VT_DILATION_HEIGHT = 22, |
| VT_DILATION_WIDTH = 24, |
| VT_CEIL_MODE = 26, |
| VT_COUNT_INCLUDE_PAD = 28, |
| VT_DIVISOR_OVERRIDE = 30, |
| VT_OUTPUT1_ID = 32, |
| VT_OUTPUT2_ID = 34 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t kernel_height() const { |
| return GetField<int32_t>(VT_KERNEL_HEIGHT, 0); |
| } |
| int32_t kernel_width() const { |
| return GetField<int32_t>(VT_KERNEL_WIDTH, 0); |
| } |
| int32_t stride_height() const { |
| return GetField<int32_t>(VT_STRIDE_HEIGHT, 0); |
| } |
| int32_t stride_width() const { |
| return GetField<int32_t>(VT_STRIDE_WIDTH, 0); |
| } |
| int32_t padding_left() const { |
| return GetField<int32_t>(VT_PADDING_LEFT, 0); |
| } |
| int32_t padding_right() const { |
| return GetField<int32_t>(VT_PADDING_RIGHT, 0); |
| } |
| int32_t padding_top() const { |
| return GetField<int32_t>(VT_PADDING_TOP, 0); |
| } |
| int32_t padding_bottom() const { |
| return GetField<int32_t>(VT_PADDING_BOTTOM, 0); |
| } |
| int32_t dilation_height() const { |
| return GetField<int32_t>(VT_DILATION_HEIGHT, 0); |
| } |
| int32_t dilation_width() const { |
| return GetField<int32_t>(VT_DILATION_WIDTH, 0); |
| } |
| bool ceil_mode() const { |
| return GetField<uint8_t>(VT_CEIL_MODE, 0) != 0; |
| } |
| bool count_include_pad() const { |
| return GetField<uint8_t>(VT_COUNT_INCLUDE_PAD, 0) != 0; |
| } |
| int32_t divisor_override() const { |
| return GetField<int32_t>(VT_DIVISOR_OVERRIDE, 0); |
| } |
| int32_t output1_id() const { |
| return GetField<int32_t>(VT_OUTPUT1_ID, 0); |
| } |
| int32_t output2_id() const { |
| return GetField<int32_t>(VT_OUTPUT2_ID, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_KERNEL_HEIGHT, 4) && |
| VerifyField<int32_t>(verifier, VT_KERNEL_WIDTH, 4) && |
| VerifyField<int32_t>(verifier, VT_STRIDE_HEIGHT, 4) && |
| VerifyField<int32_t>(verifier, VT_STRIDE_WIDTH, 4) && |
| VerifyField<int32_t>(verifier, VT_PADDING_LEFT, 4) && |
| VerifyField<int32_t>(verifier, VT_PADDING_RIGHT, 4) && |
| VerifyField<int32_t>(verifier, VT_PADDING_TOP, 4) && |
| VerifyField<int32_t>(verifier, VT_PADDING_BOTTOM, 4) && |
| VerifyField<int32_t>(verifier, VT_DILATION_HEIGHT, 4) && |
| VerifyField<int32_t>(verifier, VT_DILATION_WIDTH, 4) && |
| VerifyField<uint8_t>(verifier, VT_CEIL_MODE, 1) && |
| VerifyField<uint8_t>(verifier, VT_COUNT_INCLUDE_PAD, 1) && |
| VerifyField<int32_t>(verifier, VT_DIVISOR_OVERRIDE, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT2_ID, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSPooling2DBuilder { |
| typedef MPSPooling2D Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSPooling2D::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_kernel_height(int32_t kernel_height) { |
| fbb_.AddElement<int32_t>(MPSPooling2D::VT_KERNEL_HEIGHT, kernel_height, 0); |
| } |
| void add_kernel_width(int32_t kernel_width) { |
| fbb_.AddElement<int32_t>(MPSPooling2D::VT_KERNEL_WIDTH, kernel_width, 0); |
| } |
| void add_stride_height(int32_t stride_height) { |
| fbb_.AddElement<int32_t>(MPSPooling2D::VT_STRIDE_HEIGHT, stride_height, 0); |
| } |
| void add_stride_width(int32_t stride_width) { |
| fbb_.AddElement<int32_t>(MPSPooling2D::VT_STRIDE_WIDTH, stride_width, 0); |
| } |
| void add_padding_left(int32_t padding_left) { |
| fbb_.AddElement<int32_t>(MPSPooling2D::VT_PADDING_LEFT, padding_left, 0); |
| } |
| void add_padding_right(int32_t padding_right) { |
| fbb_.AddElement<int32_t>(MPSPooling2D::VT_PADDING_RIGHT, padding_right, 0); |
| } |
| void add_padding_top(int32_t padding_top) { |
| fbb_.AddElement<int32_t>(MPSPooling2D::VT_PADDING_TOP, padding_top, 0); |
| } |
| void add_padding_bottom(int32_t padding_bottom) { |
| fbb_.AddElement<int32_t>(MPSPooling2D::VT_PADDING_BOTTOM, padding_bottom, 0); |
| } |
| void add_dilation_height(int32_t dilation_height) { |
| fbb_.AddElement<int32_t>(MPSPooling2D::VT_DILATION_HEIGHT, dilation_height, 0); |
| } |
| void add_dilation_width(int32_t dilation_width) { |
| fbb_.AddElement<int32_t>(MPSPooling2D::VT_DILATION_WIDTH, dilation_width, 0); |
| } |
| void add_ceil_mode(bool ceil_mode) { |
| fbb_.AddElement<uint8_t>(MPSPooling2D::VT_CEIL_MODE, static_cast<uint8_t>(ceil_mode), 0); |
| } |
| void add_count_include_pad(bool count_include_pad) { |
| fbb_.AddElement<uint8_t>(MPSPooling2D::VT_COUNT_INCLUDE_PAD, static_cast<uint8_t>(count_include_pad), 0); |
| } |
| void add_divisor_override(int32_t divisor_override) { |
| fbb_.AddElement<int32_t>(MPSPooling2D::VT_DIVISOR_OVERRIDE, divisor_override, 0); |
| } |
| void add_output1_id(int32_t output1_id) { |
| fbb_.AddElement<int32_t>(MPSPooling2D::VT_OUTPUT1_ID, output1_id, 0); |
| } |
| void add_output2_id(int32_t output2_id) { |
| fbb_.AddElement<int32_t>(MPSPooling2D::VT_OUTPUT2_ID, output2_id, 0); |
| } |
| explicit MPSPooling2DBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSPooling2D> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSPooling2D>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSPooling2D> CreateMPSPooling2D( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t kernel_height = 0, |
| int32_t kernel_width = 0, |
| int32_t stride_height = 0, |
| int32_t stride_width = 0, |
| int32_t padding_left = 0, |
| int32_t padding_right = 0, |
| int32_t padding_top = 0, |
| int32_t padding_bottom = 0, |
| int32_t dilation_height = 0, |
| int32_t dilation_width = 0, |
| bool ceil_mode = false, |
| bool count_include_pad = false, |
| int32_t divisor_override = 0, |
| int32_t output1_id = 0, |
| int32_t output2_id = 0) { |
| MPSPooling2DBuilder builder_(_fbb); |
| builder_.add_output2_id(output2_id); |
| builder_.add_output1_id(output1_id); |
| builder_.add_divisor_override(divisor_override); |
| builder_.add_dilation_width(dilation_width); |
| builder_.add_dilation_height(dilation_height); |
| builder_.add_padding_bottom(padding_bottom); |
| builder_.add_padding_top(padding_top); |
| builder_.add_padding_right(padding_right); |
| builder_.add_padding_left(padding_left); |
| builder_.add_stride_width(stride_width); |
| builder_.add_stride_height(stride_height); |
| builder_.add_kernel_width(kernel_width); |
| builder_.add_kernel_height(kernel_height); |
| builder_.add_input1_id(input1_id); |
| builder_.add_count_include_pad(count_include_pad); |
| builder_.add_ceil_mode(ceil_mode); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSHardTanh FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSHardTanhBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_MIN_VALUE = 8, |
| VT_MAX_VALUE = 10 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| float min_value() const { |
| return GetField<float>(VT_MIN_VALUE, 0.0f); |
| } |
| float max_value() const { |
| return GetField<float>(VT_MAX_VALUE, 0.0f); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<float>(verifier, VT_MIN_VALUE, 4) && |
| VerifyField<float>(verifier, VT_MAX_VALUE, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSHardTanhBuilder { |
| typedef MPSHardTanh Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSHardTanh::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSHardTanh::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_min_value(float min_value) { |
| fbb_.AddElement<float>(MPSHardTanh::VT_MIN_VALUE, min_value, 0.0f); |
| } |
| void add_max_value(float max_value) { |
| fbb_.AddElement<float>(MPSHardTanh::VT_MAX_VALUE, max_value, 0.0f); |
| } |
| explicit MPSHardTanhBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSHardTanh> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSHardTanh>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSHardTanh> CreateMPSHardTanh( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| float min_value = 0.0f, |
| float max_value = 0.0f) { |
| MPSHardTanhBuilder builder_(_fbb); |
| builder_.add_max_value(max_value); |
| builder_.add_min_value(min_value); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSGELU FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSGELUBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_APPROXIMATE = 8 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| const ::flatbuffers::String *approximate() const { |
| return GetPointer<const ::flatbuffers::String *>(VT_APPROXIMATE); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyOffset(verifier, VT_APPROXIMATE) && |
| verifier.VerifyString(approximate()) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSGELUBuilder { |
| typedef MPSGELU Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSGELU::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSGELU::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_approximate(::flatbuffers::Offset<::flatbuffers::String> approximate) { |
| fbb_.AddOffset(MPSGELU::VT_APPROXIMATE, approximate); |
| } |
| explicit MPSGELUBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSGELU> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSGELU>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSGELU> CreateMPSGELU( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| ::flatbuffers::Offset<::flatbuffers::String> approximate = 0) { |
| MPSGELUBuilder builder_(_fbb); |
| builder_.add_approximate(approximate); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<MPSGELU> CreateMPSGELUDirect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| const char *approximate = nullptr) { |
| auto approximate__ = approximate ? _fbb.CreateString(approximate) : 0; |
| return mpsgraph::CreateMPSGELU( |
| _fbb, |
| input1_id, |
| output_id, |
| approximate__); |
| } |
|
|
| struct MPSLeakyReLU FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSLeakyReLUBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_NEGATIVE_SLOPE = 8 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| float negative_slope() const { |
| return GetField<float>(VT_NEGATIVE_SLOPE, 0.0f); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<float>(verifier, VT_NEGATIVE_SLOPE, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSLeakyReLUBuilder { |
| typedef MPSLeakyReLU Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSLeakyReLU::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSLeakyReLU::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_negative_slope(float negative_slope) { |
| fbb_.AddElement<float>(MPSLeakyReLU::VT_NEGATIVE_SLOPE, negative_slope, 0.0f); |
| } |
| explicit MPSLeakyReLUBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSLeakyReLU> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSLeakyReLU>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSLeakyReLU> CreateMPSLeakyReLU( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| float negative_slope = 0.0f) { |
| MPSLeakyReLUBuilder builder_(_fbb); |
| builder_.add_negative_slope(negative_slope); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSSoftmax FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSSoftmaxBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_DIM = 8, |
| VT_HALF_TO_FLOAT = 10 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| int32_t dim() const { |
| return GetField<int32_t>(VT_DIM, 0); |
| } |
| bool half_to_float() const { |
| return GetField<uint8_t>(VT_HALF_TO_FLOAT, 0) != 0; |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_DIM, 4) && |
| VerifyField<uint8_t>(verifier, VT_HALF_TO_FLOAT, 1) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSSoftmaxBuilder { |
| typedef MPSSoftmax Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSSoftmax::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSSoftmax::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_dim(int32_t dim) { |
| fbb_.AddElement<int32_t>(MPSSoftmax::VT_DIM, dim, 0); |
| } |
| void add_half_to_float(bool half_to_float) { |
| fbb_.AddElement<uint8_t>(MPSSoftmax::VT_HALF_TO_FLOAT, static_cast<uint8_t>(half_to_float), 0); |
| } |
| explicit MPSSoftmaxBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSSoftmax> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSSoftmax>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSSoftmax> CreateMPSSoftmax( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| int32_t dim = 0, |
| bool half_to_float = false) { |
| MPSSoftmaxBuilder builder_(_fbb); |
| builder_.add_dim(dim); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| builder_.add_half_to_float(half_to_float); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSClamp FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSClampBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSClampBuilder { |
| typedef MPSClamp Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSClamp::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSClamp::VT_OUTPUT_ID, output_id, 0); |
| } |
| explicit MPSClampBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSClamp> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSClamp>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSClamp> CreateMPSClamp( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0) { |
| MPSClampBuilder builder_(_fbb); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSMean FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSMeanBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_NUM_DIMS = 8, |
| VT_DIMS = 10, |
| VT_KEEP_DIMS = 12 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| int32_t num_dims() const { |
| return GetField<int32_t>(VT_NUM_DIMS, 0); |
| } |
| const ::flatbuffers::Vector<int32_t> *dims() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_DIMS); |
| } |
| bool keep_dims() const { |
| return GetField<uint8_t>(VT_KEEP_DIMS, 0) != 0; |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_NUM_DIMS, 4) && |
| VerifyOffset(verifier, VT_DIMS) && |
| verifier.VerifyVector(dims()) && |
| VerifyField<uint8_t>(verifier, VT_KEEP_DIMS, 1) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSMeanBuilder { |
| typedef MPSMean Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSMean::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSMean::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_num_dims(int32_t num_dims) { |
| fbb_.AddElement<int32_t>(MPSMean::VT_NUM_DIMS, num_dims, 0); |
| } |
| void add_dims(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> dims) { |
| fbb_.AddOffset(MPSMean::VT_DIMS, dims); |
| } |
| void add_keep_dims(bool keep_dims) { |
| fbb_.AddElement<uint8_t>(MPSMean::VT_KEEP_DIMS, static_cast<uint8_t>(keep_dims), 0); |
| } |
| explicit MPSMeanBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSMean> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSMean>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSMean> CreateMPSMean( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| int32_t num_dims = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> dims = 0, |
| bool keep_dims = false) { |
| MPSMeanBuilder builder_(_fbb); |
| builder_.add_dims(dims); |
| builder_.add_num_dims(num_dims); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| builder_.add_keep_dims(keep_dims); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<MPSMean> CreateMPSMeanDirect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| int32_t num_dims = 0, |
| const std::vector<int32_t> *dims = nullptr, |
| bool keep_dims = false) { |
| auto dims__ = dims ? _fbb.CreateVector<int32_t>(*dims) : 0; |
| return mpsgraph::CreateMPSMean( |
| _fbb, |
| input1_id, |
| output_id, |
| num_dims, |
| dims__, |
| keep_dims); |
| } |
|
|
| struct MPSIndexSelect FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSIndexSelectBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_DIM = 8, |
| VT_INDEX_ID = 10 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| int32_t dim() const { |
| return GetField<int32_t>(VT_DIM, 0); |
| } |
| int32_t index_id() const { |
| return GetField<int32_t>(VT_INDEX_ID, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_DIM, 4) && |
| VerifyField<int32_t>(verifier, VT_INDEX_ID, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSIndexSelectBuilder { |
| typedef MPSIndexSelect Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSIndexSelect::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSIndexSelect::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_dim(int32_t dim) { |
| fbb_.AddElement<int32_t>(MPSIndexSelect::VT_DIM, dim, 0); |
| } |
| void add_index_id(int32_t index_id) { |
| fbb_.AddElement<int32_t>(MPSIndexSelect::VT_INDEX_ID, index_id, 0); |
| } |
| explicit MPSIndexSelectBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSIndexSelect> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSIndexSelect>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSIndexSelect> CreateMPSIndexSelect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| int32_t dim = 0, |
| int32_t index_id = 0) { |
| MPSIndexSelectBuilder builder_(_fbb); |
| builder_.add_index_id(index_id); |
| builder_.add_dim(dim); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSEmbedding FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSEmbeddingBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_INPUT2_ID = 6, |
| VT_OUTPUT_ID = 8, |
| VT_PADDING_IDX = 10, |
| VT_SCALE_GRAD_BY_FREQ = 12, |
| VT_SPARSE = 14 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t input2_id() const { |
| return GetField<int32_t>(VT_INPUT2_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| int32_t padding_idx() const { |
| return GetField<int32_t>(VT_PADDING_IDX, 0); |
| } |
| bool scale_grad_by_freq() const { |
| return GetField<uint8_t>(VT_SCALE_GRAD_BY_FREQ, 0) != 0; |
| } |
| bool sparse() const { |
| return GetField<uint8_t>(VT_SPARSE, 0) != 0; |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_INPUT2_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_PADDING_IDX, 4) && |
| VerifyField<uint8_t>(verifier, VT_SCALE_GRAD_BY_FREQ, 1) && |
| VerifyField<uint8_t>(verifier, VT_SPARSE, 1) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSEmbeddingBuilder { |
| typedef MPSEmbedding Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSEmbedding::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_input2_id(int32_t input2_id) { |
| fbb_.AddElement<int32_t>(MPSEmbedding::VT_INPUT2_ID, input2_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSEmbedding::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_padding_idx(int32_t padding_idx) { |
| fbb_.AddElement<int32_t>(MPSEmbedding::VT_PADDING_IDX, padding_idx, 0); |
| } |
| void add_scale_grad_by_freq(bool scale_grad_by_freq) { |
| fbb_.AddElement<uint8_t>(MPSEmbedding::VT_SCALE_GRAD_BY_FREQ, static_cast<uint8_t>(scale_grad_by_freq), 0); |
| } |
| void add_sparse(bool sparse) { |
| fbb_.AddElement<uint8_t>(MPSEmbedding::VT_SPARSE, static_cast<uint8_t>(sparse), 0); |
| } |
| explicit MPSEmbeddingBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSEmbedding> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSEmbedding>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSEmbedding> CreateMPSEmbedding( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t input2_id = 0, |
| int32_t output_id = 0, |
| int32_t padding_idx = 0, |
| bool scale_grad_by_freq = false, |
| bool sparse = false) { |
| MPSEmbeddingBuilder builder_(_fbb); |
| builder_.add_padding_idx(padding_idx); |
| builder_.add_output_id(output_id); |
| builder_.add_input2_id(input2_id); |
| builder_.add_input1_id(input1_id); |
| builder_.add_sparse(sparse); |
| builder_.add_scale_grad_by_freq(scale_grad_by_freq); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSIndexTensor FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSIndexTensorBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_INDICES_ID = 6, |
| VT_OUTPUT_ID = 8 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| const ::flatbuffers::Vector<int32_t> *indices_id() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_INDICES_ID); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyOffset(verifier, VT_INDICES_ID) && |
| verifier.VerifyVector(indices_id()) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSIndexTensorBuilder { |
| typedef MPSIndexTensor Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSIndexTensor::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_indices_id(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> indices_id) { |
| fbb_.AddOffset(MPSIndexTensor::VT_INDICES_ID, indices_id); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSIndexTensor::VT_OUTPUT_ID, output_id, 0); |
| } |
| explicit MPSIndexTensorBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSIndexTensor> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSIndexTensor>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSIndexTensor> CreateMPSIndexTensor( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> indices_id = 0, |
| int32_t output_id = 0) { |
| MPSIndexTensorBuilder builder_(_fbb); |
| builder_.add_output_id(output_id); |
| builder_.add_indices_id(indices_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<MPSIndexTensor> CreateMPSIndexTensorDirect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| const std::vector<int32_t> *indices_id = nullptr, |
| int32_t output_id = 0) { |
| auto indices_id__ = indices_id ? _fbb.CreateVector<int32_t>(*indices_id) : 0; |
| return mpsgraph::CreateMPSIndexTensor( |
| _fbb, |
| input1_id, |
| indices_id__, |
| output_id); |
| } |
|
|
| struct MPSIndexPut FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSIndexPutBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_INDICES_ID = 6, |
| VT_VALUES_SHAPE = 8, |
| VT_VALUES_ID = 10, |
| VT_OUTPUT_ID = 12 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| const ::flatbuffers::Vector<int32_t> *indices_id() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_INDICES_ID); |
| } |
| const ::flatbuffers::Vector<int32_t> *values_shape() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_VALUES_SHAPE); |
| } |
| int32_t values_id() const { |
| return GetField<int32_t>(VT_VALUES_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyOffset(verifier, VT_INDICES_ID) && |
| verifier.VerifyVector(indices_id()) && |
| VerifyOffset(verifier, VT_VALUES_SHAPE) && |
| verifier.VerifyVector(values_shape()) && |
| VerifyField<int32_t>(verifier, VT_VALUES_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSIndexPutBuilder { |
| typedef MPSIndexPut Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSIndexPut::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_indices_id(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> indices_id) { |
| fbb_.AddOffset(MPSIndexPut::VT_INDICES_ID, indices_id); |
| } |
| void add_values_shape(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> values_shape) { |
| fbb_.AddOffset(MPSIndexPut::VT_VALUES_SHAPE, values_shape); |
| } |
| void add_values_id(int32_t values_id) { |
| fbb_.AddElement<int32_t>(MPSIndexPut::VT_VALUES_ID, values_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSIndexPut::VT_OUTPUT_ID, output_id, 0); |
| } |
| explicit MPSIndexPutBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSIndexPut> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSIndexPut>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSIndexPut> CreateMPSIndexPut( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> indices_id = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> values_shape = 0, |
| int32_t values_id = 0, |
| int32_t output_id = 0) { |
| MPSIndexPutBuilder builder_(_fbb); |
| builder_.add_output_id(output_id); |
| builder_.add_values_id(values_id); |
| builder_.add_values_shape(values_shape); |
| builder_.add_indices_id(indices_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<MPSIndexPut> CreateMPSIndexPutDirect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| const std::vector<int32_t> *indices_id = nullptr, |
| const std::vector<int32_t> *values_shape = nullptr, |
| int32_t values_id = 0, |
| int32_t output_id = 0) { |
| auto indices_id__ = indices_id ? _fbb.CreateVector<int32_t>(*indices_id) : 0; |
| auto values_shape__ = values_shape ? _fbb.CreateVector<int32_t>(*values_shape) : 0; |
| return mpsgraph::CreateMPSIndexPut( |
| _fbb, |
| input1_id, |
| indices_id__, |
| values_shape__, |
| values_id, |
| output_id); |
| } |
|
|
| struct MPSScatter FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSScatterBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_DIM = 8, |
| VT_IDX_ID = 10, |
| VT_SRC_ID = 12 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| int64_t dim() const { |
| return GetField<int64_t>(VT_DIM, 0); |
| } |
| int32_t idx_id() const { |
| return GetField<int32_t>(VT_IDX_ID, 0); |
| } |
| int32_t src_id() const { |
| return GetField<int32_t>(VT_SRC_ID, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<int64_t>(verifier, VT_DIM, 8) && |
| VerifyField<int32_t>(verifier, VT_IDX_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_SRC_ID, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSScatterBuilder { |
| typedef MPSScatter Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSScatter::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSScatter::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_dim(int64_t dim) { |
| fbb_.AddElement<int64_t>(MPSScatter::VT_DIM, dim, 0); |
| } |
| void add_idx_id(int32_t idx_id) { |
| fbb_.AddElement<int32_t>(MPSScatter::VT_IDX_ID, idx_id, 0); |
| } |
| void add_src_id(int32_t src_id) { |
| fbb_.AddElement<int32_t>(MPSScatter::VT_SRC_ID, src_id, 0); |
| } |
| explicit MPSScatterBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSScatter> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSScatter>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSScatter> CreateMPSScatter( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| int64_t dim = 0, |
| int32_t idx_id = 0, |
| int32_t src_id = 0) { |
| MPSScatterBuilder builder_(_fbb); |
| builder_.add_dim(dim); |
| builder_.add_src_id(src_id); |
| builder_.add_idx_id(idx_id); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSPermute FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSPermuteBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_NUM_DIMS = 8, |
| VT_PERM = 10 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| int32_t num_dims() const { |
| return GetField<int32_t>(VT_NUM_DIMS, 0); |
| } |
| const ::flatbuffers::Vector<int32_t> *perm() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_PERM); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_NUM_DIMS, 4) && |
| VerifyOffset(verifier, VT_PERM) && |
| verifier.VerifyVector(perm()) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSPermuteBuilder { |
| typedef MPSPermute Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSPermute::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSPermute::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_num_dims(int32_t num_dims) { |
| fbb_.AddElement<int32_t>(MPSPermute::VT_NUM_DIMS, num_dims, 0); |
| } |
| void add_perm(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> perm) { |
| fbb_.AddOffset(MPSPermute::VT_PERM, perm); |
| } |
| explicit MPSPermuteBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSPermute> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSPermute>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSPermute> CreateMPSPermute( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| int32_t num_dims = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> perm = 0) { |
| MPSPermuteBuilder builder_(_fbb); |
| builder_.add_perm(perm); |
| builder_.add_num_dims(num_dims); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<MPSPermute> CreateMPSPermuteDirect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| int32_t num_dims = 0, |
| const std::vector<int32_t> *perm = nullptr) { |
| auto perm__ = perm ? _fbb.CreateVector<int32_t>(*perm) : 0; |
| return mpsgraph::CreateMPSPermute( |
| _fbb, |
| input1_id, |
| output_id, |
| num_dims, |
| perm__); |
| } |
|
|
| struct MPSView FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSViewBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_NUM_DIMS = 8, |
| VT_SHAPE = 10 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| int32_t num_dims() const { |
| return GetField<int32_t>(VT_NUM_DIMS, 0); |
| } |
| const ::flatbuffers::Vector<int32_t> *shape() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_SHAPE); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_NUM_DIMS, 4) && |
| VerifyOffset(verifier, VT_SHAPE) && |
| verifier.VerifyVector(shape()) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSViewBuilder { |
| typedef MPSView Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSView::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSView::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_num_dims(int32_t num_dims) { |
| fbb_.AddElement<int32_t>(MPSView::VT_NUM_DIMS, num_dims, 0); |
| } |
| void add_shape(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> shape) { |
| fbb_.AddOffset(MPSView::VT_SHAPE, shape); |
| } |
| explicit MPSViewBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSView> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSView>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSView> CreateMPSView( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| int32_t num_dims = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> shape = 0) { |
| MPSViewBuilder builder_(_fbb); |
| builder_.add_shape(shape); |
| builder_.add_num_dims(num_dims); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<MPSView> CreateMPSViewDirect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| int32_t num_dims = 0, |
| const std::vector<int32_t> *shape = nullptr) { |
| auto shape__ = shape ? _fbb.CreateVector<int32_t>(*shape) : 0; |
| return mpsgraph::CreateMPSView( |
| _fbb, |
| input1_id, |
| output_id, |
| num_dims, |
| shape__); |
| } |
|
|
| struct MPSCat FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSCatBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT_IDS = 4, |
| VT_OUTPUT_ID = 6, |
| VT_DIM = 8 |
| }; |
| const ::flatbuffers::Vector<int32_t> *input_ids() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_INPUT_IDS); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| int32_t dim() const { |
| return GetField<int32_t>(VT_DIM, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyOffset(verifier, VT_INPUT_IDS) && |
| verifier.VerifyVector(input_ids()) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_DIM, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSCatBuilder { |
| typedef MPSCat Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input_ids(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> input_ids) { |
| fbb_.AddOffset(MPSCat::VT_INPUT_IDS, input_ids); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSCat::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_dim(int32_t dim) { |
| fbb_.AddElement<int32_t>(MPSCat::VT_DIM, dim, 0); |
| } |
| explicit MPSCatBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSCat> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSCat>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSCat> CreateMPSCat( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> input_ids = 0, |
| int32_t output_id = 0, |
| int32_t dim = 0) { |
| MPSCatBuilder builder_(_fbb); |
| builder_.add_dim(dim); |
| builder_.add_output_id(output_id); |
| builder_.add_input_ids(input_ids); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<MPSCat> CreateMPSCatDirect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| const std::vector<int32_t> *input_ids = nullptr, |
| int32_t output_id = 0, |
| int32_t dim = 0) { |
| auto input_ids__ = input_ids ? _fbb.CreateVector<int32_t>(*input_ids) : 0; |
| return mpsgraph::CreateMPSCat( |
| _fbb, |
| input_ids__, |
| output_id, |
| dim); |
| } |
|
|
| struct MPSSqueeze FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSSqueezeBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_DIMS = 8 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| const ::flatbuffers::Vector<int32_t> *dims() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_DIMS); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyOffset(verifier, VT_DIMS) && |
| verifier.VerifyVector(dims()) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSSqueezeBuilder { |
| typedef MPSSqueeze Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSSqueeze::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSSqueeze::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_dims(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> dims) { |
| fbb_.AddOffset(MPSSqueeze::VT_DIMS, dims); |
| } |
| explicit MPSSqueezeBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSSqueeze> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSSqueeze>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSSqueeze> CreateMPSSqueeze( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> dims = 0) { |
| MPSSqueezeBuilder builder_(_fbb); |
| builder_.add_dims(dims); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<MPSSqueeze> CreateMPSSqueezeDirect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| const std::vector<int32_t> *dims = nullptr) { |
| auto dims__ = dims ? _fbb.CreateVector<int32_t>(*dims) : 0; |
| return mpsgraph::CreateMPSSqueeze( |
| _fbb, |
| input1_id, |
| output_id, |
| dims__); |
| } |
|
|
| struct MPSUnsqueeze FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSUnsqueezeBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_DIM = 8 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| int32_t dim() const { |
| return GetField<int32_t>(VT_DIM, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_DIM, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSUnsqueezeBuilder { |
| typedef MPSUnsqueeze Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSUnsqueeze::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSUnsqueeze::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_dim(int32_t dim) { |
| fbb_.AddElement<int32_t>(MPSUnsqueeze::VT_DIM, dim, 0); |
| } |
| explicit MPSUnsqueezeBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSUnsqueeze> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSUnsqueeze>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSUnsqueeze> CreateMPSUnsqueeze( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| int32_t dim = 0) { |
| MPSUnsqueezeBuilder builder_(_fbb); |
| builder_.add_dim(dim); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSSelect FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSSelectBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_DIM = 8, |
| VT_INDEX = 10 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| int32_t dim() const { |
| return GetField<int32_t>(VT_DIM, 0); |
| } |
| int32_t index() const { |
| return GetField<int32_t>(VT_INDEX, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_DIM, 4) && |
| VerifyField<int32_t>(verifier, VT_INDEX, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSSelectBuilder { |
| typedef MPSSelect Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSSelect::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSSelect::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_dim(int32_t dim) { |
| fbb_.AddElement<int32_t>(MPSSelect::VT_DIM, dim, 0); |
| } |
| void add_index(int32_t index) { |
| fbb_.AddElement<int32_t>(MPSSelect::VT_INDEX, index, 0); |
| } |
| explicit MPSSelectBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSSelect> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSSelect>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSSelect> CreateMPSSelect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| int32_t dim = 0, |
| int32_t index = 0) { |
| MPSSelectBuilder builder_(_fbb); |
| builder_.add_index(index); |
| builder_.add_dim(dim); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSSlice FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSSliceBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_DIM = 8, |
| VT_START = 10, |
| VT_END = 12, |
| VT_STEP = 14 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| int64_t dim() const { |
| return GetField<int64_t>(VT_DIM, 0); |
| } |
| int64_t start() const { |
| return GetField<int64_t>(VT_START, 0); |
| } |
| int64_t end() const { |
| return GetField<int64_t>(VT_END, 0); |
| } |
| int64_t step() const { |
| return GetField<int64_t>(VT_STEP, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<int64_t>(verifier, VT_DIM, 8) && |
| VerifyField<int64_t>(verifier, VT_START, 8) && |
| VerifyField<int64_t>(verifier, VT_END, 8) && |
| VerifyField<int64_t>(verifier, VT_STEP, 8) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSSliceBuilder { |
| typedef MPSSlice Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSSlice::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSSlice::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_dim(int64_t dim) { |
| fbb_.AddElement<int64_t>(MPSSlice::VT_DIM, dim, 0); |
| } |
| void add_start(int64_t start) { |
| fbb_.AddElement<int64_t>(MPSSlice::VT_START, start, 0); |
| } |
| void add_end(int64_t end) { |
| fbb_.AddElement<int64_t>(MPSSlice::VT_END, end, 0); |
| } |
| void add_step(int64_t step) { |
| fbb_.AddElement<int64_t>(MPSSlice::VT_STEP, step, 0); |
| } |
| explicit MPSSliceBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSSlice> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSSlice>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSSlice> CreateMPSSlice( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| int64_t dim = 0, |
| int64_t start = 0, |
| int64_t end = 0, |
| int64_t step = 0) { |
| MPSSliceBuilder builder_(_fbb); |
| builder_.add_step(step); |
| builder_.add_end(end); |
| builder_.add_start(start); |
| builder_.add_dim(dim); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSPixelShuffle FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSPixelShuffleBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_UPSCALE_FACTOR = 8 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| int32_t upscale_factor() const { |
| return GetField<int32_t>(VT_UPSCALE_FACTOR, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_UPSCALE_FACTOR, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSPixelShuffleBuilder { |
| typedef MPSPixelShuffle Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSPixelShuffle::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSPixelShuffle::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_upscale_factor(int32_t upscale_factor) { |
| fbb_.AddElement<int32_t>(MPSPixelShuffle::VT_UPSCALE_FACTOR, upscale_factor, 0); |
| } |
| explicit MPSPixelShuffleBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSPixelShuffle> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSPixelShuffle>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSPixelShuffle> CreateMPSPixelShuffle( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| int32_t upscale_factor = 0) { |
| MPSPixelShuffleBuilder builder_(_fbb); |
| builder_.add_upscale_factor(upscale_factor); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSSplitWithSizes FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSSplitWithSizesBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_IDS = 6, |
| VT_SPLIT_SIZES = 8, |
| VT_DIM = 10 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| const ::flatbuffers::Vector<int32_t> *output_ids() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_OUTPUT_IDS); |
| } |
| const ::flatbuffers::Vector<int32_t> *split_sizes() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_SPLIT_SIZES); |
| } |
| int32_t dim() const { |
| return GetField<int32_t>(VT_DIM, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyOffset(verifier, VT_OUTPUT_IDS) && |
| verifier.VerifyVector(output_ids()) && |
| VerifyOffset(verifier, VT_SPLIT_SIZES) && |
| verifier.VerifyVector(split_sizes()) && |
| VerifyField<int32_t>(verifier, VT_DIM, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSSplitWithSizesBuilder { |
| typedef MPSSplitWithSizes Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSSplitWithSizes::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_ids(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> output_ids) { |
| fbb_.AddOffset(MPSSplitWithSizes::VT_OUTPUT_IDS, output_ids); |
| } |
| void add_split_sizes(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> split_sizes) { |
| fbb_.AddOffset(MPSSplitWithSizes::VT_SPLIT_SIZES, split_sizes); |
| } |
| void add_dim(int32_t dim) { |
| fbb_.AddElement<int32_t>(MPSSplitWithSizes::VT_DIM, dim, 0); |
| } |
| explicit MPSSplitWithSizesBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSSplitWithSizes> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSSplitWithSizes>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSSplitWithSizes> CreateMPSSplitWithSizes( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> output_ids = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> split_sizes = 0, |
| int32_t dim = 0) { |
| MPSSplitWithSizesBuilder builder_(_fbb); |
| builder_.add_dim(dim); |
| builder_.add_split_sizes(split_sizes); |
| builder_.add_output_ids(output_ids); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<MPSSplitWithSizes> CreateMPSSplitWithSizesDirect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| const std::vector<int32_t> *output_ids = nullptr, |
| const std::vector<int32_t> *split_sizes = nullptr, |
| int32_t dim = 0) { |
| auto output_ids__ = output_ids ? _fbb.CreateVector<int32_t>(*output_ids) : 0; |
| auto split_sizes__ = split_sizes ? _fbb.CreateVector<int32_t>(*split_sizes) : 0; |
| return mpsgraph::CreateMPSSplitWithSizes( |
| _fbb, |
| input1_id, |
| output_ids__, |
| split_sizes__, |
| dim); |
| } |
|
|
| struct MPSCast FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSCastBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_DTYPE = 8 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| mpsgraph::MPSDataType dtype() const { |
| return static_cast<mpsgraph::MPSDataType>(GetField<int16_t>(VT_DTYPE, 0)); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<int16_t>(verifier, VT_DTYPE, 2) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSCastBuilder { |
| typedef MPSCast Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSCast::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSCast::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_dtype(mpsgraph::MPSDataType dtype) { |
| fbb_.AddElement<int16_t>(MPSCast::VT_DTYPE, static_cast<int16_t>(dtype), 0); |
| } |
| explicit MPSCastBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSCast> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSCast>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSCast> CreateMPSCast( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| mpsgraph::MPSDataType dtype = mpsgraph::MPSDataType_mps_data_type_invalid) { |
| MPSCastBuilder builder_(_fbb); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| builder_.add_dtype(dtype); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSAddmm FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSAddmmBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_INPUT2_ID = 6, |
| VT_INPUT3_ID = 8, |
| VT_OUTPUT_ID = 10, |
| VT_BETA = 12, |
| VT_ALPHA = 14 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t input2_id() const { |
| return GetField<int32_t>(VT_INPUT2_ID, 0); |
| } |
| int32_t input3_id() const { |
| return GetField<int32_t>(VT_INPUT3_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| float beta() const { |
| return GetField<float>(VT_BETA, 0.0f); |
| } |
| float alpha() const { |
| return GetField<float>(VT_ALPHA, 0.0f); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_INPUT2_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_INPUT3_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<float>(verifier, VT_BETA, 4) && |
| VerifyField<float>(verifier, VT_ALPHA, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSAddmmBuilder { |
| typedef MPSAddmm Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSAddmm::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_input2_id(int32_t input2_id) { |
| fbb_.AddElement<int32_t>(MPSAddmm::VT_INPUT2_ID, input2_id, 0); |
| } |
| void add_input3_id(int32_t input3_id) { |
| fbb_.AddElement<int32_t>(MPSAddmm::VT_INPUT3_ID, input3_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSAddmm::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_beta(float beta) { |
| fbb_.AddElement<float>(MPSAddmm::VT_BETA, beta, 0.0f); |
| } |
| void add_alpha(float alpha) { |
| fbb_.AddElement<float>(MPSAddmm::VT_ALPHA, alpha, 0.0f); |
| } |
| explicit MPSAddmmBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSAddmm> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSAddmm>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSAddmm> CreateMPSAddmm( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t input2_id = 0, |
| int32_t input3_id = 0, |
| int32_t output_id = 0, |
| float beta = 0.0f, |
| float alpha = 0.0f) { |
| MPSAddmmBuilder builder_(_fbb); |
| builder_.add_alpha(alpha); |
| builder_.add_beta(beta); |
| builder_.add_output_id(output_id); |
| builder_.add_input3_id(input3_id); |
| builder_.add_input2_id(input2_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| struct _MPSFull FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef _MPSFullBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_SHAPE = 8, |
| VT_FILL_VALUE = 10, |
| VT_DTYPE = 12 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| const ::flatbuffers::Vector<int32_t> *shape() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_SHAPE); |
| } |
| float fill_value() const { |
| return GetField<float>(VT_FILL_VALUE, 0.0f); |
| } |
| mpsgraph::MPSDataType dtype() const { |
| return static_cast<mpsgraph::MPSDataType>(GetField<int16_t>(VT_DTYPE, 0)); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyOffset(verifier, VT_SHAPE) && |
| verifier.VerifyVector(shape()) && |
| VerifyField<float>(verifier, VT_FILL_VALUE, 4) && |
| VerifyField<int16_t>(verifier, VT_DTYPE, 2) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct _MPSFullBuilder { |
| typedef _MPSFull Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(_MPSFull::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(_MPSFull::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_shape(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> shape) { |
| fbb_.AddOffset(_MPSFull::VT_SHAPE, shape); |
| } |
| void add_fill_value(float fill_value) { |
| fbb_.AddElement<float>(_MPSFull::VT_FILL_VALUE, fill_value, 0.0f); |
| } |
| void add_dtype(mpsgraph::MPSDataType dtype) { |
| fbb_.AddElement<int16_t>(_MPSFull::VT_DTYPE, static_cast<int16_t>(dtype), 0); |
| } |
| explicit _MPSFullBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<_MPSFull> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<_MPSFull>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<_MPSFull> Create_MPSFull( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> shape = 0, |
| float fill_value = 0.0f, |
| mpsgraph::MPSDataType dtype = mpsgraph::MPSDataType_mps_data_type_invalid) { |
| _MPSFullBuilder builder_(_fbb); |
| builder_.add_fill_value(fill_value); |
| builder_.add_shape(shape); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| builder_.add_dtype(dtype); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<_MPSFull> Create_MPSFullDirect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| const std::vector<int32_t> *shape = nullptr, |
| float fill_value = 0.0f, |
| mpsgraph::MPSDataType dtype = mpsgraph::MPSDataType_mps_data_type_invalid) { |
| auto shape__ = shape ? _fbb.CreateVector<int32_t>(*shape) : 0; |
| return mpsgraph::Create_MPSFull( |
| _fbb, |
| input1_id, |
| output_id, |
| shape__, |
| fill_value, |
| dtype); |
| } |
|
|
| struct MPSConv FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSConvBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_INPUT2_ID = 6, |
| VT_INPUT3_ID = 8, |
| VT_OUTPUT_ID = 10, |
| VT_STRIDE_X = 12, |
| VT_STRIDE_Y = 14, |
| VT_DILATION_X = 16, |
| VT_DILATION_Y = 18, |
| VT_GROUPS = 20, |
| VT_PADDING_LEFT = 22, |
| VT_PADDING_RIGHT = 24, |
| VT_PADDING_TOP = 26, |
| VT_PADDING_BOTTOM = 28 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t input2_id() const { |
| return GetField<int32_t>(VT_INPUT2_ID, 0); |
| } |
| int32_t input3_id() const { |
| return GetField<int32_t>(VT_INPUT3_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| int32_t stride_x() const { |
| return GetField<int32_t>(VT_STRIDE_X, 0); |
| } |
| int32_t stride_y() const { |
| return GetField<int32_t>(VT_STRIDE_Y, 0); |
| } |
| int32_t dilation_x() const { |
| return GetField<int32_t>(VT_DILATION_X, 0); |
| } |
| int32_t dilation_y() const { |
| return GetField<int32_t>(VT_DILATION_Y, 0); |
| } |
| int32_t groups() const { |
| return GetField<int32_t>(VT_GROUPS, 0); |
| } |
| int32_t padding_left() const { |
| return GetField<int32_t>(VT_PADDING_LEFT, 0); |
| } |
| int32_t padding_right() const { |
| return GetField<int32_t>(VT_PADDING_RIGHT, 0); |
| } |
| int32_t padding_top() const { |
| return GetField<int32_t>(VT_PADDING_TOP, 0); |
| } |
| int32_t padding_bottom() const { |
| return GetField<int32_t>(VT_PADDING_BOTTOM, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_INPUT2_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_INPUT3_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_STRIDE_X, 4) && |
| VerifyField<int32_t>(verifier, VT_STRIDE_Y, 4) && |
| VerifyField<int32_t>(verifier, VT_DILATION_X, 4) && |
| VerifyField<int32_t>(verifier, VT_DILATION_Y, 4) && |
| VerifyField<int32_t>(verifier, VT_GROUPS, 4) && |
| VerifyField<int32_t>(verifier, VT_PADDING_LEFT, 4) && |
| VerifyField<int32_t>(verifier, VT_PADDING_RIGHT, 4) && |
| VerifyField<int32_t>(verifier, VT_PADDING_TOP, 4) && |
| VerifyField<int32_t>(verifier, VT_PADDING_BOTTOM, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSConvBuilder { |
| typedef MPSConv Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSConv::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_input2_id(int32_t input2_id) { |
| fbb_.AddElement<int32_t>(MPSConv::VT_INPUT2_ID, input2_id, 0); |
| } |
| void add_input3_id(int32_t input3_id) { |
| fbb_.AddElement<int32_t>(MPSConv::VT_INPUT3_ID, input3_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSConv::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_stride_x(int32_t stride_x) { |
| fbb_.AddElement<int32_t>(MPSConv::VT_STRIDE_X, stride_x, 0); |
| } |
| void add_stride_y(int32_t stride_y) { |
| fbb_.AddElement<int32_t>(MPSConv::VT_STRIDE_Y, stride_y, 0); |
| } |
| void add_dilation_x(int32_t dilation_x) { |
| fbb_.AddElement<int32_t>(MPSConv::VT_DILATION_X, dilation_x, 0); |
| } |
| void add_dilation_y(int32_t dilation_y) { |
| fbb_.AddElement<int32_t>(MPSConv::VT_DILATION_Y, dilation_y, 0); |
| } |
| void add_groups(int32_t groups) { |
| fbb_.AddElement<int32_t>(MPSConv::VT_GROUPS, groups, 0); |
| } |
| void add_padding_left(int32_t padding_left) { |
| fbb_.AddElement<int32_t>(MPSConv::VT_PADDING_LEFT, padding_left, 0); |
| } |
| void add_padding_right(int32_t padding_right) { |
| fbb_.AddElement<int32_t>(MPSConv::VT_PADDING_RIGHT, padding_right, 0); |
| } |
| void add_padding_top(int32_t padding_top) { |
| fbb_.AddElement<int32_t>(MPSConv::VT_PADDING_TOP, padding_top, 0); |
| } |
| void add_padding_bottom(int32_t padding_bottom) { |
| fbb_.AddElement<int32_t>(MPSConv::VT_PADDING_BOTTOM, padding_bottom, 0); |
| } |
| explicit MPSConvBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSConv> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSConv>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSConv> CreateMPSConv( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t input2_id = 0, |
| int32_t input3_id = 0, |
| int32_t output_id = 0, |
| int32_t stride_x = 0, |
| int32_t stride_y = 0, |
| int32_t dilation_x = 0, |
| int32_t dilation_y = 0, |
| int32_t groups = 0, |
| int32_t padding_left = 0, |
| int32_t padding_right = 0, |
| int32_t padding_top = 0, |
| int32_t padding_bottom = 0) { |
| MPSConvBuilder builder_(_fbb); |
| builder_.add_padding_bottom(padding_bottom); |
| builder_.add_padding_top(padding_top); |
| builder_.add_padding_right(padding_right); |
| builder_.add_padding_left(padding_left); |
| builder_.add_groups(groups); |
| builder_.add_dilation_y(dilation_y); |
| builder_.add_dilation_x(dilation_x); |
| builder_.add_stride_y(stride_y); |
| builder_.add_stride_x(stride_x); |
| builder_.add_output_id(output_id); |
| builder_.add_input3_id(input3_id); |
| builder_.add_input2_id(input2_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSBatchNorm FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSBatchNormBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT_ID = 4, |
| VT_MEAN_ID = 6, |
| VT_VAR_ID = 8, |
| VT_WEIGHT_ID = 10, |
| VT_BIAS_ID = 12, |
| VT_MOMENTUM = 14, |
| VT_EPSILON = 16, |
| VT_OUTPUT2_ID = 18, |
| VT_OUTPUT1_ID = 20, |
| VT_OUTPUT3_ID = 22 |
| }; |
| int32_t input_id() const { |
| return GetField<int32_t>(VT_INPUT_ID, 0); |
| } |
| int32_t mean_id() const { |
| return GetField<int32_t>(VT_MEAN_ID, 0); |
| } |
| int32_t var_id() const { |
| return GetField<int32_t>(VT_VAR_ID, 0); |
| } |
| int32_t weight_id() const { |
| return GetField<int32_t>(VT_WEIGHT_ID, 0); |
| } |
| int32_t bias_id() const { |
| return GetField<int32_t>(VT_BIAS_ID, 0); |
| } |
| float momentum() const { |
| return GetField<float>(VT_MOMENTUM, 0.0f); |
| } |
| float epsilon() const { |
| return GetField<float>(VT_EPSILON, 0.0f); |
| } |
| int32_t output2_id() const { |
| return GetField<int32_t>(VT_OUTPUT2_ID, 0); |
| } |
| int32_t output1_id() const { |
| return GetField<int32_t>(VT_OUTPUT1_ID, 0); |
| } |
| int32_t output3_id() const { |
| return GetField<int32_t>(VT_OUTPUT3_ID, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_MEAN_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_VAR_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_WEIGHT_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_BIAS_ID, 4) && |
| VerifyField<float>(verifier, VT_MOMENTUM, 4) && |
| VerifyField<float>(verifier, VT_EPSILON, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT2_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT3_ID, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSBatchNormBuilder { |
| typedef MPSBatchNorm Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input_id(int32_t input_id) { |
| fbb_.AddElement<int32_t>(MPSBatchNorm::VT_INPUT_ID, input_id, 0); |
| } |
| void add_mean_id(int32_t mean_id) { |
| fbb_.AddElement<int32_t>(MPSBatchNorm::VT_MEAN_ID, mean_id, 0); |
| } |
| void add_var_id(int32_t var_id) { |
| fbb_.AddElement<int32_t>(MPSBatchNorm::VT_VAR_ID, var_id, 0); |
| } |
| void add_weight_id(int32_t weight_id) { |
| fbb_.AddElement<int32_t>(MPSBatchNorm::VT_WEIGHT_ID, weight_id, 0); |
| } |
| void add_bias_id(int32_t bias_id) { |
| fbb_.AddElement<int32_t>(MPSBatchNorm::VT_BIAS_ID, bias_id, 0); |
| } |
| void add_momentum(float momentum) { |
| fbb_.AddElement<float>(MPSBatchNorm::VT_MOMENTUM, momentum, 0.0f); |
| } |
| void add_epsilon(float epsilon) { |
| fbb_.AddElement<float>(MPSBatchNorm::VT_EPSILON, epsilon, 0.0f); |
| } |
| void add_output2_id(int32_t output2_id) { |
| fbb_.AddElement<int32_t>(MPSBatchNorm::VT_OUTPUT2_ID, output2_id, 0); |
| } |
| void add_output1_id(int32_t output1_id) { |
| fbb_.AddElement<int32_t>(MPSBatchNorm::VT_OUTPUT1_ID, output1_id, 0); |
| } |
| void add_output3_id(int32_t output3_id) { |
| fbb_.AddElement<int32_t>(MPSBatchNorm::VT_OUTPUT3_ID, output3_id, 0); |
| } |
| explicit MPSBatchNormBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSBatchNorm> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSBatchNorm>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSBatchNorm> CreateMPSBatchNorm( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input_id = 0, |
| int32_t mean_id = 0, |
| int32_t var_id = 0, |
| int32_t weight_id = 0, |
| int32_t bias_id = 0, |
| float momentum = 0.0f, |
| float epsilon = 0.0f, |
| int32_t output2_id = 0, |
| int32_t output1_id = 0, |
| int32_t output3_id = 0) { |
| MPSBatchNormBuilder builder_(_fbb); |
| builder_.add_output3_id(output3_id); |
| builder_.add_output1_id(output1_id); |
| builder_.add_output2_id(output2_id); |
| builder_.add_epsilon(epsilon); |
| builder_.add_momentum(momentum); |
| builder_.add_bias_id(bias_id); |
| builder_.add_weight_id(weight_id); |
| builder_.add_var_id(var_id); |
| builder_.add_mean_id(mean_id); |
| builder_.add_input_id(input_id); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSLayerNorm FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSLayerNormBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_NORMALIZED_SHAPE = 6, |
| VT_WEIGHT_ID = 8, |
| VT_BIAS_ID = 10, |
| VT_EPS = 12, |
| VT_OUTPUT2_ID = 14, |
| VT_OUTPUT1_ID = 16, |
| VT_OUTPUT3_ID = 18 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| const ::flatbuffers::Vector<int32_t> *normalized_shape() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_NORMALIZED_SHAPE); |
| } |
| int32_t weight_id() const { |
| return GetField<int32_t>(VT_WEIGHT_ID, 0); |
| } |
| int32_t bias_id() const { |
| return GetField<int32_t>(VT_BIAS_ID, 0); |
| } |
| float eps() const { |
| return GetField<float>(VT_EPS, 0.0f); |
| } |
| int32_t output2_id() const { |
| return GetField<int32_t>(VT_OUTPUT2_ID, 0); |
| } |
| int32_t output1_id() const { |
| return GetField<int32_t>(VT_OUTPUT1_ID, 0); |
| } |
| int32_t output3_id() const { |
| return GetField<int32_t>(VT_OUTPUT3_ID, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyOffset(verifier, VT_NORMALIZED_SHAPE) && |
| verifier.VerifyVector(normalized_shape()) && |
| VerifyField<int32_t>(verifier, VT_WEIGHT_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_BIAS_ID, 4) && |
| VerifyField<float>(verifier, VT_EPS, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT2_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT3_ID, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSLayerNormBuilder { |
| typedef MPSLayerNorm Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSLayerNorm::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_normalized_shape(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> normalized_shape) { |
| fbb_.AddOffset(MPSLayerNorm::VT_NORMALIZED_SHAPE, normalized_shape); |
| } |
| void add_weight_id(int32_t weight_id) { |
| fbb_.AddElement<int32_t>(MPSLayerNorm::VT_WEIGHT_ID, weight_id, 0); |
| } |
| void add_bias_id(int32_t bias_id) { |
| fbb_.AddElement<int32_t>(MPSLayerNorm::VT_BIAS_ID, bias_id, 0); |
| } |
| void add_eps(float eps) { |
| fbb_.AddElement<float>(MPSLayerNorm::VT_EPS, eps, 0.0f); |
| } |
| void add_output2_id(int32_t output2_id) { |
| fbb_.AddElement<int32_t>(MPSLayerNorm::VT_OUTPUT2_ID, output2_id, 0); |
| } |
| void add_output1_id(int32_t output1_id) { |
| fbb_.AddElement<int32_t>(MPSLayerNorm::VT_OUTPUT1_ID, output1_id, 0); |
| } |
| void add_output3_id(int32_t output3_id) { |
| fbb_.AddElement<int32_t>(MPSLayerNorm::VT_OUTPUT3_ID, output3_id, 0); |
| } |
| explicit MPSLayerNormBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSLayerNorm> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSLayerNorm>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSLayerNorm> CreateMPSLayerNorm( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> normalized_shape = 0, |
| int32_t weight_id = 0, |
| int32_t bias_id = 0, |
| float eps = 0.0f, |
| int32_t output2_id = 0, |
| int32_t output1_id = 0, |
| int32_t output3_id = 0) { |
| MPSLayerNormBuilder builder_(_fbb); |
| builder_.add_output3_id(output3_id); |
| builder_.add_output1_id(output1_id); |
| builder_.add_output2_id(output2_id); |
| builder_.add_eps(eps); |
| builder_.add_bias_id(bias_id); |
| builder_.add_weight_id(weight_id); |
| builder_.add_normalized_shape(normalized_shape); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<MPSLayerNorm> CreateMPSLayerNormDirect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| const std::vector<int32_t> *normalized_shape = nullptr, |
| int32_t weight_id = 0, |
| int32_t bias_id = 0, |
| float eps = 0.0f, |
| int32_t output2_id = 0, |
| int32_t output1_id = 0, |
| int32_t output3_id = 0) { |
| auto normalized_shape__ = normalized_shape ? _fbb.CreateVector<int32_t>(*normalized_shape) : 0; |
| return mpsgraph::CreateMPSLayerNorm( |
| _fbb, |
| input1_id, |
| normalized_shape__, |
| weight_id, |
| bias_id, |
| eps, |
| output2_id, |
| output1_id, |
| output3_id); |
| } |
|
|
| struct MPSConstantPadND FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSConstantPadNDBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_PAD = 8, |
| VT_VALUE = 10 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| const ::flatbuffers::Vector<int32_t> *pad() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_PAD); |
| } |
| float value() const { |
| return GetField<float>(VT_VALUE, 0.0f); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyOffset(verifier, VT_PAD) && |
| verifier.VerifyVector(pad()) && |
| VerifyField<float>(verifier, VT_VALUE, 4) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSConstantPadNDBuilder { |
| typedef MPSConstantPadND Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSConstantPadND::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSConstantPadND::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_pad(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> pad) { |
| fbb_.AddOffset(MPSConstantPadND::VT_PAD, pad); |
| } |
| void add_value(float value) { |
| fbb_.AddElement<float>(MPSConstantPadND::VT_VALUE, value, 0.0f); |
| } |
| explicit MPSConstantPadNDBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSConstantPadND> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSConstantPadND>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSConstantPadND> CreateMPSConstantPadND( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> pad = 0, |
| float value = 0.0f) { |
| MPSConstantPadNDBuilder builder_(_fbb); |
| builder_.add_value(value); |
| builder_.add_pad(pad); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<MPSConstantPadND> CreateMPSConstantPadNDDirect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| const std::vector<int32_t> *pad = nullptr, |
| float value = 0.0f) { |
| auto pad__ = pad ? _fbb.CreateVector<int32_t>(*pad) : 0; |
| return mpsgraph::CreateMPSConstantPadND( |
| _fbb, |
| input1_id, |
| output_id, |
| pad__, |
| value); |
| } |
|
|
| struct MPSArange FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSArangeBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_OUTPUT_ID = 4, |
| VT_START = 6, |
| VT_END = 8, |
| VT_STEP = 10, |
| VT_DTYPE = 12 |
| }; |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| float start() const { |
| return GetField<float>(VT_START, 0.0f); |
| } |
| float end() const { |
| return GetField<float>(VT_END, 0.0f); |
| } |
| float step() const { |
| return GetField<float>(VT_STEP, 0.0f); |
| } |
| mpsgraph::MPSDataType dtype() const { |
| return static_cast<mpsgraph::MPSDataType>(GetField<int16_t>(VT_DTYPE, 0)); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<float>(verifier, VT_START, 4) && |
| VerifyField<float>(verifier, VT_END, 4) && |
| VerifyField<float>(verifier, VT_STEP, 4) && |
| VerifyField<int16_t>(verifier, VT_DTYPE, 2) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSArangeBuilder { |
| typedef MPSArange Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSArange::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_start(float start) { |
| fbb_.AddElement<float>(MPSArange::VT_START, start, 0.0f); |
| } |
| void add_end(float end) { |
| fbb_.AddElement<float>(MPSArange::VT_END, end, 0.0f); |
| } |
| void add_step(float step) { |
| fbb_.AddElement<float>(MPSArange::VT_STEP, step, 0.0f); |
| } |
| void add_dtype(mpsgraph::MPSDataType dtype) { |
| fbb_.AddElement<int16_t>(MPSArange::VT_DTYPE, static_cast<int16_t>(dtype), 0); |
| } |
| explicit MPSArangeBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSArange> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSArange>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSArange> CreateMPSArange( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t output_id = 0, |
| float start = 0.0f, |
| float end = 0.0f, |
| float step = 0.0f, |
| mpsgraph::MPSDataType dtype = mpsgraph::MPSDataType_mps_data_type_invalid) { |
| MPSArangeBuilder builder_(_fbb); |
| builder_.add_step(step); |
| builder_.add_end(end); |
| builder_.add_start(start); |
| builder_.add_output_id(output_id); |
| builder_.add_dtype(dtype); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSDequantizePerChannelGroup FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSDequantizePerChannelGroupBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_INPUT1_ID = 4, |
| VT_OUTPUT_ID = 6, |
| VT_SCALES_ID = 8, |
| VT_ZERO_POINTS_ID = 10, |
| VT_QUANT_MIN = 12, |
| VT_QUANT_MAX = 14, |
| VT_DTYPE = 16, |
| VT_GROUP_SIZE = 18, |
| VT_OUTPUT_DTYPE = 20 |
| }; |
| int32_t input1_id() const { |
| return GetField<int32_t>(VT_INPUT1_ID, 0); |
| } |
| int32_t output_id() const { |
| return GetField<int32_t>(VT_OUTPUT_ID, 0); |
| } |
| int32_t scales_id() const { |
| return GetField<int32_t>(VT_SCALES_ID, 0); |
| } |
| int32_t zero_points_id() const { |
| return GetField<int32_t>(VT_ZERO_POINTS_ID, 0); |
| } |
| int32_t quant_min() const { |
| return GetField<int32_t>(VT_QUANT_MIN, 0); |
| } |
| int32_t quant_max() const { |
| return GetField<int32_t>(VT_QUANT_MAX, 0); |
| } |
| mpsgraph::MPSDataType dtype() const { |
| return static_cast<mpsgraph::MPSDataType>(GetField<int16_t>(VT_DTYPE, 0)); |
| } |
| int32_t group_size() const { |
| return GetField<int32_t>(VT_GROUP_SIZE, 0); |
| } |
| mpsgraph::MPSDataType output_dtype() const { |
| return static_cast<mpsgraph::MPSDataType>(GetField<int16_t>(VT_OUTPUT_DTYPE, 0)); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int32_t>(verifier, VT_INPUT1_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_OUTPUT_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_SCALES_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_ZERO_POINTS_ID, 4) && |
| VerifyField<int32_t>(verifier, VT_QUANT_MIN, 4) && |
| VerifyField<int32_t>(verifier, VT_QUANT_MAX, 4) && |
| VerifyField<int16_t>(verifier, VT_DTYPE, 2) && |
| VerifyField<int32_t>(verifier, VT_GROUP_SIZE, 4) && |
| VerifyField<int16_t>(verifier, VT_OUTPUT_DTYPE, 2) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSDequantizePerChannelGroupBuilder { |
| typedef MPSDequantizePerChannelGroup Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_input1_id(int32_t input1_id) { |
| fbb_.AddElement<int32_t>(MPSDequantizePerChannelGroup::VT_INPUT1_ID, input1_id, 0); |
| } |
| void add_output_id(int32_t output_id) { |
| fbb_.AddElement<int32_t>(MPSDequantizePerChannelGroup::VT_OUTPUT_ID, output_id, 0); |
| } |
| void add_scales_id(int32_t scales_id) { |
| fbb_.AddElement<int32_t>(MPSDequantizePerChannelGroup::VT_SCALES_ID, scales_id, 0); |
| } |
| void add_zero_points_id(int32_t zero_points_id) { |
| fbb_.AddElement<int32_t>(MPSDequantizePerChannelGroup::VT_ZERO_POINTS_ID, zero_points_id, 0); |
| } |
| void add_quant_min(int32_t quant_min) { |
| fbb_.AddElement<int32_t>(MPSDequantizePerChannelGroup::VT_QUANT_MIN, quant_min, 0); |
| } |
| void add_quant_max(int32_t quant_max) { |
| fbb_.AddElement<int32_t>(MPSDequantizePerChannelGroup::VT_QUANT_MAX, quant_max, 0); |
| } |
| void add_dtype(mpsgraph::MPSDataType dtype) { |
| fbb_.AddElement<int16_t>(MPSDequantizePerChannelGroup::VT_DTYPE, static_cast<int16_t>(dtype), 0); |
| } |
| void add_group_size(int32_t group_size) { |
| fbb_.AddElement<int32_t>(MPSDequantizePerChannelGroup::VT_GROUP_SIZE, group_size, 0); |
| } |
| void add_output_dtype(mpsgraph::MPSDataType output_dtype) { |
| fbb_.AddElement<int16_t>(MPSDequantizePerChannelGroup::VT_OUTPUT_DTYPE, static_cast<int16_t>(output_dtype), 0); |
| } |
| explicit MPSDequantizePerChannelGroupBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSDequantizePerChannelGroup> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSDequantizePerChannelGroup>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSDequantizePerChannelGroup> CreateMPSDequantizePerChannelGroup( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| int32_t input1_id = 0, |
| int32_t output_id = 0, |
| int32_t scales_id = 0, |
| int32_t zero_points_id = 0, |
| int32_t quant_min = 0, |
| int32_t quant_max = 0, |
| mpsgraph::MPSDataType dtype = mpsgraph::MPSDataType_mps_data_type_invalid, |
| int32_t group_size = 0, |
| mpsgraph::MPSDataType output_dtype = mpsgraph::MPSDataType_mps_data_type_invalid) { |
| MPSDequantizePerChannelGroupBuilder builder_(_fbb); |
| builder_.add_group_size(group_size); |
| builder_.add_quant_max(quant_max); |
| builder_.add_quant_min(quant_min); |
| builder_.add_zero_points_id(zero_points_id); |
| builder_.add_scales_id(scales_id); |
| builder_.add_output_id(output_id); |
| builder_.add_input1_id(input1_id); |
| builder_.add_output_dtype(output_dtype); |
| builder_.add_dtype(dtype); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSNode FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSNodeBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_MPSNODE_UNION_TYPE = 4, |
| VT_MPSNODE_UNION = 6, |
| VT_MIN_MAX = 8 |
| }; |
| mpsgraph::MPSNodeUnion mpsnode_union_type() const { |
| return static_cast<mpsgraph::MPSNodeUnion>(GetField<uint8_t>(VT_MPSNODE_UNION_TYPE, 0)); |
| } |
| const void *mpsnode_union() const { |
| return GetPointer<const void *>(VT_MPSNODE_UNION); |
| } |
| const mpsgraph::MPSHardTanh *mpsnode_union_as_MPSHardTanh() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSHardTanh ? static_cast<const mpsgraph::MPSHardTanh *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSReLU() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSReLU ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSGELU *mpsnode_union_as_MPSGELU() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSGELU ? static_cast<const mpsgraph::MPSGELU *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSLeakyReLU *mpsnode_union_as_MPSLeakyReLU() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSLeakyReLU ? static_cast<const mpsgraph::MPSLeakyReLU *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSSoftmax *mpsnode_union_as_MPSSoftmax() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSSoftmax ? static_cast<const mpsgraph::MPSSoftmax *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSSoftmax *mpsnode_union_as_MPSLogSoftmax() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSLogSoftmax ? static_cast<const mpsgraph::MPSSoftmax *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNodeWithAlpha2x1 *mpsnode_union_as_MPSAdd() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSAdd ? static_cast<const mpsgraph::_MPSNodeWithAlpha2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNodeWithAlpha2x1 *mpsnode_union_as_MPSSub() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSSub ? static_cast<const mpsgraph::_MPSNodeWithAlpha2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSMul() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSMul ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSDivNode2x1 *mpsnode_union_as_MPSDiv() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSDiv ? static_cast<const mpsgraph::_MPSDivNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSDivNode2x1 *mpsnode_union_as_MPSFmod() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSFmod ? static_cast<const mpsgraph::_MPSDivNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSDivNode2x1 *mpsnode_union_as_MPSRemainder() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSRemainder ? static_cast<const mpsgraph::_MPSDivNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSMin() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSMin ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSMax() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSMax ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSPow() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSPow ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSAtan2() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSAtan2 ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSBitwiseAnd() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSBitwiseAnd ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSBitwiseOr() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSBitwiseOr ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSBitwiseXor() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSBitwiseXor ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSMinimum() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSMinimum ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSExp() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSExp ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSExp2() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSExp2 ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSReciprocal() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSReciprocal ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSSqrt() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSSqrt ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSNeg() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSNeg ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSLog() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSLog ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSLog10() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSLog10 ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSLog2() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSLog2 ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSErf() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSErf ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSFloor() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSFloor ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSCeil() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSCeil ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSRsqrt() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSRsqrt ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSSigmoid() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSSigmoid ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSSin() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSSin ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSSign() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSSign ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSCos() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSCos ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSTan() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSTan ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSAbs() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSAbs ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSAsin() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSAsin ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSAcos() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSAcos ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSAtan() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSAtan ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSSinh() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSSinh ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSCosh() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSCosh ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSTanh() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSTanh ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSAsinh() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSAsinh ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSAcosh() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSAcosh ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSAtanh() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSAtanh ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSBitwiseNot() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSBitwiseNot ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSIsnan() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSIsnan ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSIsinf() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSIsinf ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSRound() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSRound ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode1x1 *mpsnode_union_as_MPSLogicalNot() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSLogicalNot ? static_cast<const mpsgraph::_MPSNode1x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSMatMul() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSMatMul ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSAddmm *mpsnode_union_as_MPSAddmm() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSAddmm ? static_cast<const mpsgraph::MPSAddmm *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSFull *mpsnode_union_as_MPSFull() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSFull ? static_cast<const mpsgraph::_MPSFull *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSFull *mpsnode_union_as_MPSFullLike() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSFullLike ? static_cast<const mpsgraph::_MPSFull *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSClamp *mpsnode_union_as_MPSClamp() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSClamp ? static_cast<const mpsgraph::MPSClamp *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode3x1 *mpsnode_union_as_MPSWhere() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSWhere ? static_cast<const mpsgraph::_MPSNode3x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSIndexSelect *mpsnode_union_as_MPSIndexSelect() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSIndexSelect ? static_cast<const mpsgraph::MPSIndexSelect *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSEmbedding *mpsnode_union_as_MPSEmbedding() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSEmbedding ? static_cast<const mpsgraph::MPSEmbedding *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSIndexTensor *mpsnode_union_as_MPSIndexTensor() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSIndexTensor ? static_cast<const mpsgraph::MPSIndexTensor *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSIndexPut *mpsnode_union_as_MPSIndexPut() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSIndexPut ? static_cast<const mpsgraph::MPSIndexPut *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSScatter *mpsnode_union_as_MPSScatter() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSScatter ? static_cast<const mpsgraph::MPSScatter *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSMean *mpsnode_union_as_MPSMean() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSMean ? static_cast<const mpsgraph::MPSMean *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSPermute *mpsnode_union_as_MPSPermute() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSPermute ? static_cast<const mpsgraph::MPSPermute *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSView *mpsnode_union_as_MPSView() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSView ? static_cast<const mpsgraph::MPSView *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSView *mpsnode_union_as_MPSExpand() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSExpand ? static_cast<const mpsgraph::MPSView *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSCat *mpsnode_union_as_MPSCat() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSCat ? static_cast<const mpsgraph::MPSCat *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSSqueeze *mpsnode_union_as_MPSSqueeze() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSSqueeze ? static_cast<const mpsgraph::MPSSqueeze *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSUnsqueeze *mpsnode_union_as_MPSUnsqueeze() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSUnsqueeze ? static_cast<const mpsgraph::MPSUnsqueeze *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSSelect *mpsnode_union_as_MPSSelect() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSSelect ? static_cast<const mpsgraph::MPSSelect *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSSlice *mpsnode_union_as_MPSSlice() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSSlice ? static_cast<const mpsgraph::MPSSlice *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSPixelShuffle *mpsnode_union_as_MPSPixelShuffle() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSPixelShuffle ? static_cast<const mpsgraph::MPSPixelShuffle *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSSplitWithSizes *mpsnode_union_as_MPSSplitWithSizes() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSSplitWithSizes ? static_cast<const mpsgraph::MPSSplitWithSizes *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSCast *mpsnode_union_as_MPSCast() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSCast ? static_cast<const mpsgraph::MPSCast *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSConv *mpsnode_union_as_MPSConv2D() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSConv2D ? static_cast<const mpsgraph::MPSConv *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSConv *mpsnode_union_as_MPSDepthwiseConv2D() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSDepthwiseConv2D ? static_cast<const mpsgraph::MPSConv *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSEq() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSEq ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSNe() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSNe ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSGe() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSGe ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSGt() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSGt ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSLe() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSLe ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::_MPSNode2x1 *mpsnode_union_as_MPSLt() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSLt ? static_cast<const mpsgraph::_MPSNode2x1 *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSBatchNorm *mpsnode_union_as_MPSBatchNorm() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSBatchNorm ? static_cast<const mpsgraph::MPSBatchNorm *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSLayerNorm *mpsnode_union_as_MPSLayerNorm() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSLayerNorm ? static_cast<const mpsgraph::MPSLayerNorm *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSPooling2D *mpsnode_union_as_MPSMaxPool2DWithIndices() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSMaxPool2DWithIndices ? static_cast<const mpsgraph::MPSPooling2D *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSPooling2D *mpsnode_union_as_MPSAvgPool2D() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSAvgPool2D ? static_cast<const mpsgraph::MPSPooling2D *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSConstantPadND *mpsnode_union_as_MPSConstantPadND() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSConstantPadND ? static_cast<const mpsgraph::MPSConstantPadND *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSArange *mpsnode_union_as_MPSArange() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSArange ? static_cast<const mpsgraph::MPSArange *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSDequantizePerChannelGroup *mpsnode_union_as_MPSDequantizePerChannelGroup() const { |
| return mpsnode_union_type() == mpsgraph::MPSNodeUnion_MPSDequantizePerChannelGroup ? static_cast<const mpsgraph::MPSDequantizePerChannelGroup *>(mpsnode_union()) : nullptr; |
| } |
| const mpsgraph::MPSMinMax *min_max() const { |
| return GetPointer<const mpsgraph::MPSMinMax *>(VT_MIN_MAX); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<uint8_t>(verifier, VT_MPSNODE_UNION_TYPE, 1) && |
| VerifyOffset(verifier, VT_MPSNODE_UNION) && |
| VerifyMPSNodeUnion(verifier, mpsnode_union(), mpsnode_union_type()) && |
| VerifyOffset(verifier, VT_MIN_MAX) && |
| verifier.VerifyTable(min_max()) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSNodeBuilder { |
| typedef MPSNode Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_mpsnode_union_type(mpsgraph::MPSNodeUnion mpsnode_union_type) { |
| fbb_.AddElement<uint8_t>(MPSNode::VT_MPSNODE_UNION_TYPE, static_cast<uint8_t>(mpsnode_union_type), 0); |
| } |
| void add_mpsnode_union(::flatbuffers::Offset<void> mpsnode_union) { |
| fbb_.AddOffset(MPSNode::VT_MPSNODE_UNION, mpsnode_union); |
| } |
| void add_min_max(::flatbuffers::Offset<mpsgraph::MPSMinMax> min_max) { |
| fbb_.AddOffset(MPSNode::VT_MIN_MAX, min_max); |
| } |
| explicit MPSNodeBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSNode> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSNode>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSNode> CreateMPSNode( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| mpsgraph::MPSNodeUnion mpsnode_union_type = mpsgraph::MPSNodeUnion_NONE, |
| ::flatbuffers::Offset<void> mpsnode_union = 0, |
| ::flatbuffers::Offset<mpsgraph::MPSMinMax> min_max = 0) { |
| MPSNodeBuilder builder_(_fbb); |
| builder_.add_min_max(min_max); |
| builder_.add_mpsnode_union(mpsnode_union); |
| builder_.add_mpsnode_union_type(mpsnode_union_type); |
| return builder_.Finish(); |
| } |
|
|
| struct Buffer FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef BufferBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_STORAGE = 4 |
| }; |
| const ::flatbuffers::Vector<uint8_t> *storage() const { |
| return GetPointer<const ::flatbuffers::Vector<uint8_t> *>(VT_STORAGE); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyOffset(verifier, VT_STORAGE) && |
| verifier.VerifyVector(storage()) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct BufferBuilder { |
| typedef Buffer Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_storage(::flatbuffers::Offset<::flatbuffers::Vector<uint8_t>> storage) { |
| fbb_.AddOffset(Buffer::VT_STORAGE, storage); |
| } |
| explicit BufferBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<Buffer> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<Buffer>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<Buffer> CreateBuffer( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| ::flatbuffers::Offset<::flatbuffers::Vector<uint8_t>> storage = 0) { |
| BufferBuilder builder_(_fbb); |
| builder_.add_storage(storage); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<Buffer> CreateBufferDirect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| const std::vector<uint8_t> *storage = nullptr) { |
| if (storage) { _fbb.ForceVectorAlignment(storage->size(), sizeof(uint8_t), 16); } |
| auto storage__ = storage ? _fbb.CreateVector<uint8_t>(*storage) : 0; |
| return mpsgraph::CreateBuffer( |
| _fbb, |
| storage__); |
| } |
|
|
| struct MPSTensor FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSTensorBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_DATATYPE = 4, |
| VT_NUM_DIMS = 6, |
| VT_DIMS = 8, |
| VT_CONSTANT_BUFFER_SIZE = 10, |
| VT_CONSTANT_BUFFER = 12, |
| VT_SEGMENT_OFFSET = 14 |
| }; |
| mpsgraph::MPSDataType datatype() const { |
| return static_cast<mpsgraph::MPSDataType>(GetField<int16_t>(VT_DATATYPE, 0)); |
| } |
| int32_t num_dims() const { |
| return GetField<int32_t>(VT_NUM_DIMS, 0); |
| } |
| const ::flatbuffers::Vector<int32_t> *dims() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_DIMS); |
| } |
| uint64_t constant_buffer_size() const { |
| return GetField<uint64_t>(VT_CONSTANT_BUFFER_SIZE, 0); |
| } |
| const mpsgraph::Buffer *constant_buffer() const { |
| return GetPointer<const mpsgraph::Buffer *>(VT_CONSTANT_BUFFER); |
| } |
| uint64_t segment_offset() const { |
| return GetField<uint64_t>(VT_SEGMENT_OFFSET, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<int16_t>(verifier, VT_DATATYPE, 2) && |
| VerifyField<int32_t>(verifier, VT_NUM_DIMS, 4) && |
| VerifyOffset(verifier, VT_DIMS) && |
| verifier.VerifyVector(dims()) && |
| VerifyField<uint64_t>(verifier, VT_CONSTANT_BUFFER_SIZE, 8) && |
| VerifyOffset(verifier, VT_CONSTANT_BUFFER) && |
| verifier.VerifyTable(constant_buffer()) && |
| VerifyField<uint64_t>(verifier, VT_SEGMENT_OFFSET, 8) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSTensorBuilder { |
| typedef MPSTensor Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_datatype(mpsgraph::MPSDataType datatype) { |
| fbb_.AddElement<int16_t>(MPSTensor::VT_DATATYPE, static_cast<int16_t>(datatype), 0); |
| } |
| void add_num_dims(int32_t num_dims) { |
| fbb_.AddElement<int32_t>(MPSTensor::VT_NUM_DIMS, num_dims, 0); |
| } |
| void add_dims(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> dims) { |
| fbb_.AddOffset(MPSTensor::VT_DIMS, dims); |
| } |
| void add_constant_buffer_size(uint64_t constant_buffer_size) { |
| fbb_.AddElement<uint64_t>(MPSTensor::VT_CONSTANT_BUFFER_SIZE, constant_buffer_size, 0); |
| } |
| void add_constant_buffer(::flatbuffers::Offset<mpsgraph::Buffer> constant_buffer) { |
| fbb_.AddOffset(MPSTensor::VT_CONSTANT_BUFFER, constant_buffer); |
| } |
| void add_segment_offset(uint64_t segment_offset) { |
| fbb_.AddElement<uint64_t>(MPSTensor::VT_SEGMENT_OFFSET, segment_offset, 0); |
| } |
| explicit MPSTensorBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSTensor> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSTensor>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSTensor> CreateMPSTensor( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| mpsgraph::MPSDataType datatype = mpsgraph::MPSDataType_mps_data_type_invalid, |
| int32_t num_dims = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> dims = 0, |
| uint64_t constant_buffer_size = 0, |
| ::flatbuffers::Offset<mpsgraph::Buffer> constant_buffer = 0, |
| uint64_t segment_offset = 0) { |
| MPSTensorBuilder builder_(_fbb); |
| builder_.add_segment_offset(segment_offset); |
| builder_.add_constant_buffer_size(constant_buffer_size); |
| builder_.add_constant_buffer(constant_buffer); |
| builder_.add_dims(dims); |
| builder_.add_num_dims(num_dims); |
| builder_.add_datatype(datatype); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<MPSTensor> CreateMPSTensorDirect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| mpsgraph::MPSDataType datatype = mpsgraph::MPSDataType_mps_data_type_invalid, |
| int32_t num_dims = 0, |
| const std::vector<int32_t> *dims = nullptr, |
| uint64_t constant_buffer_size = 0, |
| ::flatbuffers::Offset<mpsgraph::Buffer> constant_buffer = 0, |
| uint64_t segment_offset = 0) { |
| auto dims__ = dims ? _fbb.CreateVector<int32_t>(*dims) : 0; |
| return mpsgraph::CreateMPSTensor( |
| _fbb, |
| datatype, |
| num_dims, |
| dims__, |
| constant_buffer_size, |
| constant_buffer, |
| segment_offset); |
| } |
|
|
| struct DataSegment FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef DataSegmentBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_OFFSET = 4, |
| VT_SIZE = 6 |
| }; |
| uint64_t offset() const { |
| return GetField<uint64_t>(VT_OFFSET, 0); |
| } |
| uint64_t size() const { |
| return GetField<uint64_t>(VT_SIZE, 0); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyField<uint64_t>(verifier, VT_OFFSET, 8) && |
| VerifyField<uint64_t>(verifier, VT_SIZE, 8) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct DataSegmentBuilder { |
| typedef DataSegment Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_offset(uint64_t offset) { |
| fbb_.AddElement<uint64_t>(DataSegment::VT_OFFSET, offset, 0); |
| } |
| void add_size(uint64_t size) { |
| fbb_.AddElement<uint64_t>(DataSegment::VT_SIZE, size, 0); |
| } |
| explicit DataSegmentBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<DataSegment> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<DataSegment>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<DataSegment> CreateDataSegment( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| uint64_t offset = 0, |
| uint64_t size = 0) { |
| DataSegmentBuilder builder_(_fbb); |
| builder_.add_size(size); |
| builder_.add_offset(offset); |
| return builder_.Finish(); |
| } |
|
|
| struct MPSGraph FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { |
| typedef MPSGraphBuilder Builder; |
| enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| VT_VERSION = 4, |
| VT_MPS_NODES = 6, |
| VT_MPS_VALUES = 8, |
| VT_INPUT_IDS = 10, |
| VT_OUTPUT_IDS = 12, |
| VT_CONSTANT_IDS = 14, |
| VT_GRAPH_TYPE = 16, |
| VT_CONSTANT_SEGMENT = 18 |
| }; |
| const ::flatbuffers::String *version() const { |
| return GetPointer<const ::flatbuffers::String *>(VT_VERSION); |
| } |
| const ::flatbuffers::Vector<::flatbuffers::Offset<mpsgraph::MPSNode>> *mps_nodes() const { |
| return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<mpsgraph::MPSNode>> *>(VT_MPS_NODES); |
| } |
| const ::flatbuffers::Vector<::flatbuffers::Offset<mpsgraph::MPSTensor>> *mps_values() const { |
| return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<mpsgraph::MPSTensor>> *>(VT_MPS_VALUES); |
| } |
| const ::flatbuffers::Vector<int32_t> *input_ids() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_INPUT_IDS); |
| } |
| const ::flatbuffers::Vector<int32_t> *output_ids() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_OUTPUT_IDS); |
| } |
| const ::flatbuffers::Vector<int32_t> *constant_ids() const { |
| return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_CONSTANT_IDS); |
| } |
| mpsgraph::OpType graph_type() const { |
| return static_cast<mpsgraph::OpType>(GetField<int16_t>(VT_GRAPH_TYPE, 0)); |
| } |
| const mpsgraph::DataSegment *constant_segment() const { |
| return GetPointer<const mpsgraph::DataSegment *>(VT_CONSTANT_SEGMENT); |
| } |
| bool Verify(::flatbuffers::Verifier &verifier) const { |
| return VerifyTableStart(verifier) && |
| VerifyOffset(verifier, VT_VERSION) && |
| verifier.VerifyString(version()) && |
| VerifyOffset(verifier, VT_MPS_NODES) && |
| verifier.VerifyVector(mps_nodes()) && |
| verifier.VerifyVectorOfTables(mps_nodes()) && |
| VerifyOffset(verifier, VT_MPS_VALUES) && |
| verifier.VerifyVector(mps_values()) && |
| verifier.VerifyVectorOfTables(mps_values()) && |
| VerifyOffset(verifier, VT_INPUT_IDS) && |
| verifier.VerifyVector(input_ids()) && |
| VerifyOffset(verifier, VT_OUTPUT_IDS) && |
| verifier.VerifyVector(output_ids()) && |
| VerifyOffset(verifier, VT_CONSTANT_IDS) && |
| verifier.VerifyVector(constant_ids()) && |
| VerifyField<int16_t>(verifier, VT_GRAPH_TYPE, 2) && |
| VerifyOffset(verifier, VT_CONSTANT_SEGMENT) && |
| verifier.VerifyTable(constant_segment()) && |
| verifier.EndTable(); |
| } |
| }; |
|
|
| struct MPSGraphBuilder { |
| typedef MPSGraph Table; |
| ::flatbuffers::FlatBufferBuilder &fbb_; |
| ::flatbuffers::uoffset_t start_; |
| void add_version(::flatbuffers::Offset<::flatbuffers::String> version) { |
| fbb_.AddOffset(MPSGraph::VT_VERSION, version); |
| } |
| void add_mps_nodes(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<mpsgraph::MPSNode>>> mps_nodes) { |
| fbb_.AddOffset(MPSGraph::VT_MPS_NODES, mps_nodes); |
| } |
| void add_mps_values(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<mpsgraph::MPSTensor>>> mps_values) { |
| fbb_.AddOffset(MPSGraph::VT_MPS_VALUES, mps_values); |
| } |
| void add_input_ids(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> input_ids) { |
| fbb_.AddOffset(MPSGraph::VT_INPUT_IDS, input_ids); |
| } |
| void add_output_ids(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> output_ids) { |
| fbb_.AddOffset(MPSGraph::VT_OUTPUT_IDS, output_ids); |
| } |
| void add_constant_ids(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> constant_ids) { |
| fbb_.AddOffset(MPSGraph::VT_CONSTANT_IDS, constant_ids); |
| } |
| void add_graph_type(mpsgraph::OpType graph_type) { |
| fbb_.AddElement<int16_t>(MPSGraph::VT_GRAPH_TYPE, static_cast<int16_t>(graph_type), 0); |
| } |
| void add_constant_segment(::flatbuffers::Offset<mpsgraph::DataSegment> constant_segment) { |
| fbb_.AddOffset(MPSGraph::VT_CONSTANT_SEGMENT, constant_segment); |
| } |
| explicit MPSGraphBuilder(::flatbuffers::FlatBufferBuilder &_fbb) |
| : fbb_(_fbb) { |
| start_ = fbb_.StartTable(); |
| } |
| ::flatbuffers::Offset<MPSGraph> Finish() { |
| const auto end = fbb_.EndTable(start_); |
| auto o = ::flatbuffers::Offset<MPSGraph>(end); |
| return o; |
| } |
| }; |
|
|
| inline ::flatbuffers::Offset<MPSGraph> CreateMPSGraph( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| ::flatbuffers::Offset<::flatbuffers::String> version = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<mpsgraph::MPSNode>>> mps_nodes = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<mpsgraph::MPSTensor>>> mps_values = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> input_ids = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> output_ids = 0, |
| ::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> constant_ids = 0, |
| mpsgraph::OpType graph_type = mpsgraph::OpType_mps_graph, |
| ::flatbuffers::Offset<mpsgraph::DataSegment> constant_segment = 0) { |
| MPSGraphBuilder builder_(_fbb); |
| builder_.add_constant_segment(constant_segment); |
| builder_.add_constant_ids(constant_ids); |
| builder_.add_output_ids(output_ids); |
| builder_.add_input_ids(input_ids); |
| builder_.add_mps_values(mps_values); |
| builder_.add_mps_nodes(mps_nodes); |
| builder_.add_version(version); |
| builder_.add_graph_type(graph_type); |
| return builder_.Finish(); |
| } |
|
|
| inline ::flatbuffers::Offset<MPSGraph> CreateMPSGraphDirect( |
| ::flatbuffers::FlatBufferBuilder &_fbb, |
| const char *version = nullptr, |
| const std::vector<::flatbuffers::Offset<mpsgraph::MPSNode>> *mps_nodes = nullptr, |
| const std::vector<::flatbuffers::Offset<mpsgraph::MPSTensor>> *mps_values = nullptr, |
| const std::vector<int32_t> *input_ids = nullptr, |
| const std::vector<int32_t> *output_ids = nullptr, |
| const std::vector<int32_t> *constant_ids = nullptr, |
| mpsgraph::OpType graph_type = mpsgraph::OpType_mps_graph, |
| ::flatbuffers::Offset<mpsgraph::DataSegment> constant_segment = 0) { |
| auto version__ = version ? _fbb.CreateString(version) : 0; |
| auto mps_nodes__ = mps_nodes ? _fbb.CreateVector<::flatbuffers::Offset<mpsgraph::MPSNode>>(*mps_nodes) : 0; |
| auto mps_values__ = mps_values ? _fbb.CreateVector<::flatbuffers::Offset<mpsgraph::MPSTensor>>(*mps_values) : 0; |
| auto input_ids__ = input_ids ? _fbb.CreateVector<int32_t>(*input_ids) : 0; |
| auto output_ids__ = output_ids ? _fbb.CreateVector<int32_t>(*output_ids) : 0; |
| auto constant_ids__ = constant_ids ? _fbb.CreateVector<int32_t>(*constant_ids) : 0; |
| return mpsgraph::CreateMPSGraph( |
| _fbb, |
| version__, |
| mps_nodes__, |
| mps_values__, |
| input_ids__, |
| output_ids__, |
| constant_ids__, |
| graph_type, |
| constant_segment); |
| } |
|
|
| inline bool VerifyMPSNodeUnion(::flatbuffers::Verifier &verifier, const void *obj, MPSNodeUnion type) { |
| switch (type) { |
| case MPSNodeUnion_NONE: { |
| return true; |
| } |
| case MPSNodeUnion_MPSHardTanh: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSHardTanh *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSReLU: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSGELU: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSGELU *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSLeakyReLU: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSLeakyReLU *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSSoftmax: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSSoftmax *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSLogSoftmax: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSSoftmax *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSAdd: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNodeWithAlpha2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSSub: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNodeWithAlpha2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSMul: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSDiv: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSDivNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSFmod: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSDivNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSRemainder: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSDivNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSMin: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSMax: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSPow: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSAtan2: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSBitwiseAnd: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSBitwiseOr: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSBitwiseXor: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSMinimum: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSExp: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSExp2: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSReciprocal: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSSqrt: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSNeg: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSLog: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSLog10: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSLog2: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSErf: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSFloor: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSCeil: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSRsqrt: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSSigmoid: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSSin: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSSign: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSCos: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSTan: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSAbs: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSAsin: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSAcos: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSAtan: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSSinh: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSCosh: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSTanh: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSAsinh: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSAcosh: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSAtanh: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSBitwiseNot: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSIsnan: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSIsinf: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSRound: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSLogicalNot: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode1x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSMatMul: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSAddmm: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSAddmm *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSFull: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSFull *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSFullLike: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSFull *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSClamp: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSClamp *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSWhere: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode3x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSIndexSelect: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSIndexSelect *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSEmbedding: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSEmbedding *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSIndexTensor: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSIndexTensor *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSIndexPut: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSIndexPut *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSScatter: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSScatter *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSMean: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSMean *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSPermute: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSPermute *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSView: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSView *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSExpand: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSView *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSCat: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSCat *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSSqueeze: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSSqueeze *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSUnsqueeze: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSUnsqueeze *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSSelect: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSSelect *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSSlice: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSSlice *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSPixelShuffle: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSPixelShuffle *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSSplitWithSizes: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSSplitWithSizes *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSCast: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSCast *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSConv2D: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSConv *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSDepthwiseConv2D: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSConv *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSEq: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSNe: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSGe: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSGt: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSLe: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSLt: { |
| auto ptr = reinterpret_cast<const mpsgraph::_MPSNode2x1 *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSBatchNorm: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSBatchNorm *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSLayerNorm: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSLayerNorm *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSMaxPool2DWithIndices: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSPooling2D *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSAvgPool2D: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSPooling2D *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSConstantPadND: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSConstantPadND *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSArange: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSArange *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| case MPSNodeUnion_MPSDequantizePerChannelGroup: { |
| auto ptr = reinterpret_cast<const mpsgraph::MPSDequantizePerChannelGroup *>(obj); |
| return verifier.VerifyTable(ptr); |
| } |
| default: return true; |
| } |
| } |
|
|
| inline bool VerifyMPSNodeUnionVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset<void>> *values, const ::flatbuffers::Vector<uint8_t> *types) { |
| if (!values || !types) return !values && !types; |
| if (values->size() != types->size()) return false; |
| for (::flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { |
| if (!VerifyMPSNodeUnion( |
| verifier, values->Get(i), types->GetEnum<MPSNodeUnion>(i))) { |
| return false; |
| } |
| } |
| return true; |
| } |
|
|
| inline const mpsgraph::MPSGraph *GetMPSGraph(const void *buf) { |
| return ::flatbuffers::GetRoot<mpsgraph::MPSGraph>(buf); |
| } |
|
|
| inline const mpsgraph::MPSGraph *GetSizePrefixedMPSGraph(const void *buf) { |
| return ::flatbuffers::GetSizePrefixedRoot<mpsgraph::MPSGraph>(buf); |
| } |
|
|
| inline const char *MPSGraphIdentifier() { |
| return "MP00"; |
| } |
|
|
| inline bool MPSGraphBufferHasIdentifier(const void *buf) { |
| return ::flatbuffers::BufferHasIdentifier( |
| buf, MPSGraphIdentifier()); |
| } |
|
|
| inline bool SizePrefixedMPSGraphBufferHasIdentifier(const void *buf) { |
| return ::flatbuffers::BufferHasIdentifier( |
| buf, MPSGraphIdentifier(), true); |
| } |
|
|
| inline bool VerifyMPSGraphBuffer( |
| ::flatbuffers::Verifier &verifier) { |
| return verifier.VerifyBuffer<mpsgraph::MPSGraph>(MPSGraphIdentifier()); |
| } |
|
|
| inline bool VerifySizePrefixedMPSGraphBuffer( |
| ::flatbuffers::Verifier &verifier) { |
| return verifier.VerifySizePrefixedBuffer<mpsgraph::MPSGraph>(MPSGraphIdentifier()); |
| } |
|
|
| inline void FinishMPSGraphBuffer( |
| ::flatbuffers::FlatBufferBuilder &fbb, |
| ::flatbuffers::Offset<mpsgraph::MPSGraph> root) { |
| fbb.Finish(root, MPSGraphIdentifier()); |
| } |
|
|
| inline void FinishSizePrefixedMPSGraphBuffer( |
| ::flatbuffers::FlatBufferBuilder &fbb, |
| ::flatbuffers::Offset<mpsgraph::MPSGraph> root) { |
| fbb.FinishSizePrefixed(root, MPSGraphIdentifier()); |
| } |
|
|
| } |
|
|
| #endif |
|
|