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 NotEqualOptions {
382 message LeakyReluOptions {
383 optional float alpha = 1 [default = 0.2];
386 message ResizeNearestNeighborOptions {
387 optional bool align_corners = 1 [default = false];
390 message ResizeBilinearOptions {
391 optional bool align_corners = 1 [default = false];
392 optional bool half_pixel_centers = 2 [default = false];
395 message DepthToSpaceOptions {
396 optional int32 block_size = 1;
399 message TransposeConvOptions {
400 optional Padding padding = 1 [default = VALID];
401 optional int32 stride_w = 2 [default = 1];
402 optional int32 stride_h = 3 [default = 1];
405 message ReverseSequenceOptions {
406 optional int32 seq_dim = 1 [default = 0];
407 optional int32 batch_dim = 2 [default = 0];
410 message RankOptions {
414 message SegmentSumOptions {
418 message UniqueOptions {
419 optional TensorType idx_out_type = 1 [default = INT32];
422 message WhereOptions {
426 message SparseToDenseOptions {
427 optional bool validate_indices = 1 [default = true];
430 message ReverseV2Options {
434 message MatrixDiagOptions {
438 message MatrixSetDiagOptions {
443 optional string type = 1;
444 repeated string input = 2;
445 repeated string output = 3;
446 optional int32 version = 4 [default = 1];
448 optional Conv2DOptions conv2d_options = 100;
449 optional Pool2DOptions averagepool2d_options = 101;
450 optional ConcatenationOptions concatenation_options = 102;
451 optional Pool2DOptions maxpool2d_options = 103;
452 optional ReshapeOptions reshape_options = 104;
453 optional DepthwiseConv2DOptions depthwiseconv2d_options = 105;
454 optional SubOptions sub_options = 106;
455 optional DivOptions div_options = 107;
456 optional FullyConnectedOptions fullyconnected_options = 108;
457 optional AddOptions add_options = 109;
458 optional ArgMaxOptions argmax_options = 110;
459 optional PadOptions pad_options = 111;
460 optional SoftmaxOptions softmax_options = 112;
461 optional MulOptions mul_options = 113;
462 optional ReducerOptions mean_options = 114;
463 optional TransposeOptions transpose_options = 115;
464 optional PackOptions pack_options = 116;
465 optional LogicalOrOptions logical_or_options = 117;
466 optional LogicalNotOptions logical_not_options = 118;
467 optional LogicalAndOptions logical_and_options = 119;
468 optional AbsOptions abs_options = 120;
469 optional CosOptions cos_options = 121;
470 optional EqualOptions equal_options = 122;
471 optional ShapeOptions shape_options = 123;
472 optional FloorDivOptions floordiv_options = 124;
473 optional BatchToSpaceNDOptions batch_to_space_options = 125;
474 optional ExpOptions exp_options = 126;
475 optional UnpackOptions unpack_options = 127;
476 optional GatherOptions gather_options = 128;
477 optional BatchMatMulOptions batch_matmul_options = 129;
478 optional TileOptions tile_options = 130;
479 optional IfOptions if_options = 131;
480 optional WhileOptions while_options = 132;
481 optional SpaceToBatchNDOptions space_to_batch_nd_options = 133;
482 optional CastOptions cast_options = 134;
483 optional GreaterEqualOptions greaterequal_options = 135;
484 optional MaximumMinimumOptions maximum_options = 136;
485 optional StridedSliceOptions strided_slice_options = 137;
486 optional SquaredDifferenceOptions squared_difference_options = 138;
487 optional FillOptions fill_options = 139;
488 optional SelectOptions select_options = 140;
489 optional ReducerOptions reduce_prod_options = 141;
490 optional SplitOptions split_options = 142;
491 optional SplitVOptions split_v_options = 143;
492 optional ReducerOptions sum_options = 144;
493 optional GreaterOptions greater_options = 145;
494 optional SqueezeOptions squeeze_options = 146;
495 optional FloorModOptions floormod_options = 147;
496 optional OneHotOptions onehot_options = 148;
497 optional LessOptions less_options = 149;
498 optional ReducerOptions reduce_max_options = 150;
499 optional MaximumMinimumOptions minimum_options = 151;
500 optional ReducerOptions reduce_any_options = 152;
501 optional ZerosLikeOptions zeros_like_options = 153;
502 // ConcatEmbeddingsOptions 154
503 // LSHProjectionOptions 155
506 optional L2NormOptions l2norm_options = 158;
507 optional LocalResponseNormalizationOptions local_response_normalization_options = 159;
509 optional ResizeBilinearOptions resize_bilinear_options = 161;
511 // SkipGramOptions 163
512 optional SpaceToDepthOptions space_to_depth_options = 164;
513 // EmbeddingLookupSparseOptions 165
514 // SequenceRNNOptions 166
515 optional TopKV2Options topk_v2_options = 167;
516 optional LogSoftmaxOptions log_softmax_options = 168;
517 // DequantizeOptions 169
518 optional NegOptions neg_options = 170;
519 optional PadV2Options padv2_options = 171;
520 optional LessEqualOptions lessequal_options = 172;
521 optional SliceOptions slice_options = 173;
522 optional TransposeConvOptions transpose_conv_options = 174;
523 optional SparseToDenseOptions sparse_to_dense_options = 175;
524 optional PowOptions pow_options = 176;
525 optional ArgMinOptions argmin_options = 177;
526 // FakeQuantOptions 178
527 // BidirectionalSequenceLSTMOptions 179
528 // BidirectionalSequenceRNNOptions 180
529 // UnidirectionalSequenceLSTMOptions 181
530 optional RangeOptions range_options = 182;
531 optional ResizeNearestNeighborOptions resize_nearest_neighbor_options = 183;
532 optional LeakyReluOptions leaky_relu_options = 184;
533 optional MirrorPadOptions mirrorpad_options = 185;
534 optional UniqueOptions unique_options = 186;
535 optional ReverseV2Options reversev2_options = 187;
537 optional GatherNdOptions gather_nd_options = 189;
538 optional WhereOptions where_options = 190;
539 optional RankOptions rank_options = 191;
540 optional ReverseSequenceOptions reverse_sequence_options = 192;
541 optional MatrixDiagOptions matrix_diag_options = 193;
542 // QuantizeOptions 194
543 optional MatrixSetDiagOptions matrix_set_diag_options = 195;
544 // HardSwishOptions 196
545 optional DepthToSpaceOptions depth_to_space_options = 197;
546 optional NonMaxSuppressionV4Options non_max_suppression_v4_options = 198;
547 // NonMaxSuppressionV5Options 199
548 optional ScatterNdOptions scatter_nd_options = 200;
549 optional NotEqualOptions notequal_options = 201;
550 optional ExpandDimsOptions expand_dims_options = 202;
551 optional Pool2DOptions l2pool2d_options = 203;
552 optional ReducerOptions all_options = 204;
553 optional ReducerOptions reduce_min_options = 205;
554 optional SegmentSumOptions segment_sum_options = 206;
555 optional AddNOptions add_n_options = 207;
556 optional MatMulOptions matmul_options = 208;
558 // NOTE if there are more than two options with same type of Options
559 // use the number not listed in the above reserve list
562 // For additional subgraphs
564 repeated Operand operand = 1;
565 repeated Operation operation = 2;
566 repeated string input = 3;
567 repeated string output = 4;
568 optional string name = 5;
571 message ModelRecipe {
572 repeated Operand operand = 1;
573 repeated Operation operation = 2;
574 repeated string input = 3;
575 repeated string output = 4;
576 optional string name = 5;
577 optional uint32 version = 6 [default = 1];
578 repeated Graph graph = 7;