7 // - Our initial version
10 // - Backward compatible with Initial version
11 // - Added Graph to represent sub graphs
12 // - Added name, version(default as 1), graph in ModelRecipe
15 // This enum value corresponds to TensorType in TensorFlow Lite schema
25 repeated uint32 dim = 3;
28 message TensorFiller {
29 optional string tag = 1;
30 repeated string arg = 2;
33 message TensorQuantization {
34 repeated float min = 1;
35 repeated float max = 2;
36 repeated float scale = 3;
37 repeated int64 zero_point = 4;
38 optional int32 quantized_dimension = 5 [default = 0];
42 optional string name = 1;
43 optional TensorType type = 2;
44 optional TensorShape shape = 3;
45 optional TensorFiller filler = 4;
46 optional TensorQuantization quant = 5;
49 // This enum value corresponds to Padding in TensorFlow Lite schema
55 // This enum value corresponds to ActivationFunctionType in TensorFlow Lite schema
63 // This enum value corresponds to MirrorPadMode in TensorFlow Lite schema
71 optional Padding padding = 1 [default = VALID];
72 optional int32 stride_w = 2 [default = 1];
73 optional int32 stride_h = 3 [default = 1];
74 optional Activation activation = 4 [default = NONE];
75 optional int32 dilation_w_factor = 5 [default = 1];
76 optional int32 dilation_h_factor = 6 [default = 1];
79 message Pool2DOptions {
80 optional Padding padding = 1 [default = VALID];
81 optional int32 stride_w = 2 [default = 1];
82 optional int32 stride_h = 3 [default = 1];
83 optional int32 filter_width = 4 [default = 1];
84 optional int32 filter_height = 5 [ default = 1];
85 optional Activation activation = 6 [default = NONE];
88 message ConcatenationOptions {
89 optional int32 axis = 1 [default = 0];
90 optional Activation activation = 2 [default = NONE];
93 message ReshapeOptions {
94 repeated int32 new_shape = 1;
97 message DepthwiseConv2DOptions
99 optional Padding padding = 1 [default = VALID];
100 optional int32 stride_w = 2 [default = 1];
101 optional int32 stride_h = 3 [default = 1];
102 optional int32 depth_multiplier = 4 [default = 1];
103 optional Activation activation = 5 [default = NONE];
104 optional int32 dilation_w_factor = 6 [default = 1];
105 optional int32 dilation_h_factor = 7 [default = 1];
108 message ScatterNdOptions {
113 optional Activation activation = 1 [default = NONE];
117 optional Activation activation = 1 [default = NONE];
120 message FloorDivOptions {
124 message FloorModOptions {
128 message FullyConnectedOptions {
129 optional Activation activation = 1 [default = NONE];
133 optional Activation activation = 1 [default = NONE];
136 message AddNOptions {
140 message ArgMaxOptions {
141 optional TensorType output_type = 1 [default = INT64];
144 message ArgMinOptions {
145 optional TensorType output_type = 1 [default = INT64];
148 message PackOptions {
149 optional int32 values_count = 1;
150 optional int32 axis = 2 [default = 0];
157 message PadV2Options {
161 message MirrorPadOptions {
162 optional MirrorPadMode mode = 1 [default = REFLECT];
165 message SoftmaxOptions {
166 optional float beta = 1 [default = 0.0];
170 optional Activation activation = 1 [default = NONE];
177 message RangeOptions {
181 message ReducerOptions {
182 optional bool keep_dims = 1 [ default = false ];
185 message SpaceToDepthOptions {
186 optional int32 block_size = 1;
189 message LogicalOrOptions {
193 message LogicalNotOptions {
197 message LogicalAndOptions {
201 message TransposeOptions {
213 message EqualOptions {
217 message ShapeOptions {
218 optional TensorType out_type = 1 [default = INT32];
221 message BatchToSpaceNDOptions {
225 message SpaceToBatchNDOptions {
229 message StridedSliceOptions {
230 optional int32 begin_mask = 1;
231 optional int32 end_mask = 2;
232 optional int32 ellipsis_mask = 3;
233 optional int32 new_axis_mask = 4;
234 optional int32 shrink_axis_mask = 5;
237 message SliceOptions {
245 message ExpandDimsOptions {
249 message UnpackOptions {
250 optional int32 num = 1;
251 optional int32 axis = 2 [default = 0];
254 message GatherOptions {
255 optional int32 axis = 1 [default = 0];
258 message TileOptions {
262 message BatchMatMulOptions {
263 optional bool adj_x = 1 [default = false];
264 optional bool adj_y = 2 [default = false];
268 optional int32 then_subgraph_index = 1;
269 optional int32 else_subgraph_index = 2;
272 message WhileOptions {
273 optional int32 cond_subgraph_index = 1;
274 optional int32 body_subgraph_index = 2;
277 message CastOptions {
278 optional TensorType in_data_type = 1 [default = FLOAT32];
279 optional TensorType out_data_type = 2 [default = FLOAT32];
282 message SquareOptions {
286 message MaximumMinimumOptions {
290 message GreaterEqualOptions {
294 message SelectOptions {
298 message SelectV2Options {
302 message SplitOptions {
303 optional int32 num_splits = 1;
306 message SplitVOptions {
307 optional int32 num_splits = 1;
310 message SquaredDifferenceOptions {
314 message FillOptions {
318 message GreaterOptions {
322 message L2NormOptions {
323 optional Activation activation = 1 [default = NONE];
326 message LessOptions {
330 message LessEqualOptions {
334 message LocalResponseNormalizationOptions {
335 optional int32 radius = 1 [default = 5];
336 optional float bias = 2 [default = 1.0];
337 optional float alpha = 3 [default = 1.0];
338 optional float beta = 4 [default = 0.5];
341 message MatMulOptions {
342 optional bool transpose_a = 1 [default = false];
343 optional bool transpose_b = 2 [default = false];
346 message SqueezeOptions {
347 repeated int32 squeeze_dim = 1;
350 message OneHotOptions {
351 optional int32 axis = 1 [default = -1];
354 message TopKV2Options {
358 message LogSoftmaxOptions {
362 message ZerosLikeOptions {
366 message GatherNdOptions {
370 message NonMaxSuppressionV4Options {
374 message NonMaxSuppressionV5Options {
378 message NotEqualOptions {
386 message LeakyReluOptions {
387 optional float alpha = 1 [default = 0.2];
390 message ResizeNearestNeighborOptions {
391 optional bool align_corners = 1 [default = false];
394 message ResizeBilinearOptions {
395 optional bool align_corners = 1 [default = false];
396 optional bool half_pixel_centers = 2 [default = false];
399 message DepthToSpaceOptions {
400 optional int32 block_size = 1;
403 message TransposeConvOptions {
404 optional Padding padding = 1 [default = VALID];
405 optional int32 stride_w = 2 [default = 1];
406 optional int32 stride_h = 3 [default = 1];
409 message ReverseSequenceOptions {
410 optional int32 seq_dim = 1 [default = 0];
411 optional int32 batch_dim = 2 [default = 0];
414 message RankOptions {
418 message SegmentSumOptions {
422 message UniqueOptions {
423 optional TensorType idx_out_type = 1 [default = INT32];
426 message WhereOptions {
430 message SparseToDenseOptions {
431 optional bool validate_indices = 1 [default = true];
434 message ReverseV2Options {
438 message MatrixDiagOptions {
442 message MatrixSetDiagOptions {
447 optional string type = 1;
448 repeated string input = 2;
449 repeated string output = 3;
450 optional int32 version = 4 [default = 1];
452 optional Conv2DOptions conv2d_options = 100;
453 optional Pool2DOptions averagepool2d_options = 101;
454 optional ConcatenationOptions concatenation_options = 102;
455 optional Pool2DOptions maxpool2d_options = 103;
456 optional ReshapeOptions reshape_options = 104;
457 optional DepthwiseConv2DOptions depthwiseconv2d_options = 105;
458 optional SubOptions sub_options = 106;
459 optional DivOptions div_options = 107;
460 optional FullyConnectedOptions fullyconnected_options = 108;
461 optional AddOptions add_options = 109;
462 optional ArgMaxOptions argmax_options = 110;
463 optional PadOptions pad_options = 111;
464 optional SoftmaxOptions softmax_options = 112;
465 optional MulOptions mul_options = 113;
466 optional ReducerOptions mean_options = 114;
467 optional TransposeOptions transpose_options = 115;
468 optional PackOptions pack_options = 116;
469 optional LogicalOrOptions logical_or_options = 117;
470 optional LogicalNotOptions logical_not_options = 118;
471 optional LogicalAndOptions logical_and_options = 119;
472 optional AbsOptions abs_options = 120;
473 optional CosOptions cos_options = 121;
474 optional EqualOptions equal_options = 122;
475 optional ShapeOptions shape_options = 123;
476 optional FloorDivOptions floordiv_options = 124;
477 optional BatchToSpaceNDOptions batch_to_space_options = 125;
478 optional ExpOptions exp_options = 126;
479 optional UnpackOptions unpack_options = 127;
480 optional GatherOptions gather_options = 128;
481 optional BatchMatMulOptions batch_matmul_options = 129;
482 optional TileOptions tile_options = 130;
483 optional IfOptions if_options = 131;
484 optional WhileOptions while_options = 132;
485 optional SpaceToBatchNDOptions space_to_batch_nd_options = 133;
486 optional CastOptions cast_options = 134;
487 optional GreaterEqualOptions greaterequal_options = 135;
488 optional MaximumMinimumOptions maximum_options = 136;
489 optional StridedSliceOptions strided_slice_options = 137;
490 optional SquaredDifferenceOptions squared_difference_options = 138;
491 optional FillOptions fill_options = 139;
492 optional SelectOptions select_options = 140;
493 optional ReducerOptions reduce_prod_options = 141;
494 optional SplitOptions split_options = 142;
495 optional SplitVOptions split_v_options = 143;
496 optional ReducerOptions sum_options = 144;
497 optional GreaterOptions greater_options = 145;
498 optional SqueezeOptions squeeze_options = 146;
499 optional FloorModOptions floormod_options = 147;
500 optional OneHotOptions onehot_options = 148;
501 optional LessOptions less_options = 149;
502 optional ReducerOptions reduce_max_options = 150;
503 optional MaximumMinimumOptions minimum_options = 151;
504 optional ReducerOptions reduce_any_options = 152;
505 optional ZerosLikeOptions zeros_like_options = 153;
506 // ConcatEmbeddingsOptions 154
507 // LSHProjectionOptions 155
510 optional L2NormOptions l2norm_options = 158;
511 optional LocalResponseNormalizationOptions local_response_normalization_options = 159;
513 optional ResizeBilinearOptions resize_bilinear_options = 161;
515 // SkipGramOptions 163
516 optional SpaceToDepthOptions space_to_depth_options = 164;
517 // EmbeddingLookupSparseOptions 165
518 // SequenceRNNOptions 166
519 optional TopKV2Options topk_v2_options = 167;
520 optional LogSoftmaxOptions log_softmax_options = 168;
521 // DequantizeOptions 169
522 optional NegOptions neg_options = 170;
523 optional PadV2Options padv2_options = 171;
524 optional LessEqualOptions lessequal_options = 172;
525 optional SliceOptions slice_options = 173;
526 optional TransposeConvOptions transpose_conv_options = 174;
527 optional SparseToDenseOptions sparse_to_dense_options = 175;
528 optional PowOptions pow_options = 176;
529 optional ArgMinOptions argmin_options = 177;
530 // FakeQuantOptions 178
531 // BidirectionalSequenceLSTMOptions 179
532 // BidirectionalSequenceRNNOptions 180
533 // UnidirectionalSequenceLSTMOptions 181
534 optional RangeOptions range_options = 182;
535 optional ResizeNearestNeighborOptions resize_nearest_neighbor_options = 183;
536 optional LeakyReluOptions leaky_relu_options = 184;
537 optional MirrorPadOptions mirrorpad_options = 185;
538 optional UniqueOptions unique_options = 186;
539 optional ReverseV2Options reversev2_options = 187;
541 optional GatherNdOptions gather_nd_options = 189;
542 optional WhereOptions where_options = 190;
543 optional RankOptions rank_options = 191;
544 optional ReverseSequenceOptions reverse_sequence_options = 192;
545 optional MatrixDiagOptions matrix_diag_options = 193;
546 // QuantizeOptions 194
547 optional MatrixSetDiagOptions matrix_set_diag_options = 195;
548 // HardSwishOptions 196
549 optional DepthToSpaceOptions depth_to_space_options = 197;
550 optional NonMaxSuppressionV4Options non_max_suppression_v4_options = 198;
551 optional NonMaxSuppressionV5Options non_max_suppression_v5_options = 199;
552 optional ScatterNdOptions scatter_nd_options = 200;
553 optional NotEqualOptions notequal_options = 201;
554 optional ExpandDimsOptions expand_dims_options = 202;
555 optional Pool2DOptions l2pool2d_options = 203;
556 optional ReducerOptions all_options = 204;
557 optional ReducerOptions reduce_min_options = 205;
558 optional SegmentSumOptions segment_sum_options = 206;
559 optional AddNOptions add_n_options = 207;
560 optional MatMulOptions matmul_options = 208;
562 // NOTE if there are more than two options with same type of Options
563 // use the number not listed in the above reserve list
566 // For additional subgraphs
568 repeated Operand operand = 1;
569 repeated Operation operation = 2;
570 repeated string input = 3;
571 repeated string output = 4;
572 optional string name = 5;
575 message ModelRecipe {
576 repeated Operand operand = 1;
577 repeated Operation operation = 2;
578 repeated string input = 3;
579 repeated string output = 4;
580 optional string name = 5;
581 optional uint32 version = 6 [default = 1];
582 repeated Graph graph = 7;