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;
41 optional string name = 1;
42 optional TensorType type = 2;
43 optional TensorShape shape = 3;
44 optional TensorFiller filler = 4;
45 optional TensorQuantization quant = 5;
48 // This enum value corresponds to Padding in TensorFlow Lite schema
54 // This enum value corresponds to ActivationFunctionType in TensorFlow Lite schema
62 // This enum value corresponds to MirrorPadMode in TensorFlow Lite schema
70 optional Padding padding = 1 [default = VALID];
71 optional int32 stride_w = 2 [default = 1];
72 optional int32 stride_h = 3 [default = 1];
73 optional Activation activation = 4 [default = NONE];
74 optional int32 dilation_w_factor = 5 [default = 1];
75 optional int32 dilation_h_factor = 6 [default = 1];
78 message Pool2DOptions {
79 optional Padding padding = 1 [default = VALID];
80 optional int32 stride_w = 2 [default = 1];
81 optional int32 stride_h = 3 [default = 1];
82 optional int32 filter_width = 4 [default = 1];
83 optional int32 filter_height = 5 [ default = 1];
84 optional Activation activation = 6 [default = NONE];
87 message ConcatenationOptions {
88 optional int32 axis = 1 [default = 0];
89 optional Activation activation = 2 [default = NONE];
92 message ReshapeOptions {
93 repeated int32 new_shape = 1;
96 message DepthwiseConv2DOptions
98 optional Padding padding = 1 [default = VALID];
99 optional int32 stride_w = 2 [default = 1];
100 optional int32 stride_h = 3 [default = 1];
101 optional int32 depth_multiplier = 4 [default = 1];
102 optional Activation activation = 5 [default = NONE];
103 optional int32 dilation_w_factor = 6 [default = 1];
104 optional int32 dilation_h_factor = 7 [default = 1];
107 message ScatterNdOptions {
112 optional Activation activation = 1 [default = NONE];
116 optional Activation activation = 1 [default = NONE];
119 message FloorDivOptions {
123 message FloorModOptions {
127 message FullyConnectedOptions {
128 optional Activation activation = 1 [default = NONE];
132 optional Activation activation = 1 [default = NONE];
135 message AddNOptions {
139 message ArgMaxOptions {
140 optional TensorType output_type = 1 [default = INT64];
143 message ArgMinOptions {
144 optional TensorType output_type = 1 [default = INT64];
147 message PackOptions {
148 optional int32 values_count = 1;
149 optional int32 axis = 2 [default = 0];
156 message MirrorPadOptions {
157 optional MirrorPadMode mode = 1 [default = REFLECT];
160 message SoftmaxOptions {
161 optional float beta = 1 [default = 0.0];
165 optional Activation activation = 1 [default = NONE];
172 message RangeOptions {
176 message ReducerOptions {
177 optional bool keep_dims = 1 [ default = false ];
180 message SpaceToDepthOptions {
181 optional int32 block_size = 1;
184 message LogicalOrOptions {
188 message LogicalNotOptions {
192 message LogicalAndOptions {
196 message TransposeOptions {
208 message EqualOptions {
212 message ShapeOptions {
213 optional TensorType out_type = 1 [default = INT32];
216 message BatchToSpaceNDOptions {
220 message SpaceToBatchNDOptions {
224 message StridedSliceOptions {
225 optional int32 begin_mask = 1;
226 optional int32 end_mask = 2;
227 optional int32 ellipsis_mask = 3;
228 optional int32 new_axis_mask = 4;
229 optional int32 shrink_axis_mask = 5;
232 message SliceOptions {
240 message ExpandDimsOptions {
244 message UnpackOptions {
245 optional int32 num = 1;
246 optional int32 axis = 2 [default = 0];
249 message GatherOptions {
250 optional int32 axis = 1 [default = 0];
253 message TileOptions {
257 message BatchMatMulOptions {
258 optional bool adj_x = 1 [default = false];
259 optional bool adj_y = 2 [default = false];
263 optional int32 then_subgraph_index = 1;
264 optional int32 else_subgraph_index = 2;
267 message WhileOptions {
268 optional int32 cond_subgraph_index = 1;
269 optional int32 body_subgraph_index = 2;
272 message CastOptions {
273 optional TensorType in_data_type = 1 [default = FLOAT32];
274 optional TensorType out_data_type = 2 [default = FLOAT32];
277 message SquareOptions {
281 message MaximumMinimumOptions {
285 message GreaterEqualOptions {
289 message SelectOptions {
293 message SelectV2Options {
297 message SplitOptions {
298 optional int32 num_splits = 1;
301 message SplitVOptions {
302 optional int32 num_splits = 1;
305 message SquaredDifferenceOptions {
309 message FillOptions {
313 message GreaterOptions {
317 message L2NormOptions {
318 optional Activation activation = 1 [default = NONE];
321 message LessOptions {
325 message LessEqualOptions {
329 message LocalResponseNormalizationOptions {
330 optional int32 radius = 1 [default = 5];
331 optional float bias = 2 [default = 1.0];
332 optional float alpha = 3 [default = 1.0];
333 optional float beta = 4 [default = 0.5];
336 message MatMulOptions {
337 optional bool transpose_a = 1 [default = false];
338 optional bool transpose_b = 2 [default = false];
341 message SqueezeOptions {
342 repeated int32 squeeze_dim = 1;
345 message OneHotOptions {
346 optional int32 axis = 1 [default = -1];
349 message TopKV2Options {
353 message LogSoftmaxOptions {
357 message ZerosLikeOptions {
361 message GatherNdOptions {
365 message NotEqualOptions {
373 message LeakyReluOptions {
374 optional float alpha = 1 [default = 0.2];
377 message ResizeNearestNeighborOptions {
378 optional bool align_corners = 1 [default = false];
381 message ResizeBilinearOptions {
382 optional bool align_corners = 1 [default = false];
383 optional bool half_pixel_centers = 2 [default = false];
386 message DepthToSpaceOptions {
387 optional int32 block_size = 1;
390 message TransposeConvOptions {
391 optional Padding padding = 1 [default = VALID];
392 optional int32 stride_w = 2 [default = 1];
393 optional int32 stride_h = 3 [default = 1];
396 message ReverseSequenceOptions {
397 optional int32 seq_dim = 1 [default = 0];
398 optional int32 batch_dim = 2 [default = 0];
401 message RankOptions {
405 message SegmentSumOptions {
409 message UniqueOptions {
410 optional TensorType idx_out_type = 1 [default = INT32];
413 message WhereOptions {
417 message SparseToDenseOptions {
418 optional bool validate_indices = 1 [default = true];
421 message ReverseV2Options {
425 message MatrixDiagOptions {
429 message MatrixSetDiagOptions {
434 optional string type = 1;
435 repeated string input = 2;
436 repeated string output = 3;
437 optional int32 version = 4 [default = 1];
439 optional Conv2DOptions conv2d_options = 100;
440 optional Pool2DOptions averagepool2d_options = 101;
441 optional ConcatenationOptions concatenation_options = 102;
442 optional Pool2DOptions maxpool2d_options = 103;
443 optional ReshapeOptions reshape_options = 104;
444 optional DepthwiseConv2DOptions depthwiseconv2d_options = 105;
445 optional SubOptions sub_options = 106;
446 optional DivOptions div_options = 107;
447 optional FullyConnectedOptions fullyconnected_options = 108;
448 optional AddOptions add_options = 109;
449 optional ArgMaxOptions argmax_options = 110;
450 optional PadOptions pad_options = 111;
451 optional SoftmaxOptions softmax_options = 112;
452 optional MulOptions mul_options = 113;
453 optional ReducerOptions mean_options = 114;
454 optional TransposeOptions transpose_options = 115;
455 optional PackOptions pack_options = 116;
456 optional LogicalOrOptions logical_or_options = 117;
457 optional LogicalNotOptions logical_not_options = 118;
458 optional LogicalAndOptions logical_and_options = 119;
459 optional AbsOptions abs_options = 120;
460 optional CosOptions cos_options = 121;
461 optional EqualOptions equal_options = 122;
462 optional ShapeOptions shape_options = 123;
463 optional FloorDivOptions floordiv_options = 124;
464 optional BatchToSpaceNDOptions batch_to_space_options = 125;
465 optional ExpOptions exp_options = 126;
466 optional UnpackOptions unpack_options = 127;
467 optional GatherOptions gather_options = 128;
468 optional BatchMatMulOptions batch_matmul_options = 129;
469 optional TileOptions tile_options = 130;
470 optional IfOptions if_options = 131;
471 optional WhileOptions while_options = 132;
472 optional SpaceToBatchNDOptions space_to_batch_nd_options = 133;
473 optional CastOptions cast_options = 134;
474 optional GreaterEqualOptions greaterequal_options = 135;
475 optional MaximumMinimumOptions maximum_options = 136;
476 optional StridedSliceOptions strided_slice_options = 137;
477 optional SquaredDifferenceOptions squared_difference_options = 138;
478 optional FillOptions fill_options = 139;
479 optional SelectOptions select_options = 140;
480 optional ReducerOptions reduce_prod_options = 141;
481 optional SplitOptions split_options = 142;
482 optional SplitVOptions split_v_options = 143;
483 optional ReducerOptions sum_options = 144;
484 optional GreaterOptions greater_options = 145;
485 optional SqueezeOptions squeeze_options = 146;
486 optional FloorModOptions floormod_options = 147;
487 optional OneHotOptions onehot_options = 148;
488 optional LessOptions less_options = 149;
489 optional ReducerOptions reduce_max_options = 150;
490 optional MaximumMinimumOptions minimum_options = 151;
491 optional ReducerOptions reduce_any_options = 152;
492 optional ZerosLikeOptions zeros_like_options = 153;
493 // ConcatEmbeddingsOptions 154
494 // LSHProjectionOptions 155
497 optional L2NormOptions l2norm_options = 158;
498 optional LocalResponseNormalizationOptions local_response_normalization_options = 159;
500 optional ResizeBilinearOptions resize_bilinear_options = 161;
502 // SkipGramOptions 163
503 optional SpaceToDepthOptions space_to_depth_options = 164;
504 // EmbeddingLookupSparseOptions 165
505 // SequenceRNNOptions 166
506 optional TopKV2Options topk_v2_options = 167;
507 optional LogSoftmaxOptions log_softmax_options = 168;
508 // DequantizeOptions 169
509 optional NegOptions neg_options = 170;
511 optional LessEqualOptions lessequal_options = 172;
512 optional SliceOptions slice_options = 173;
513 optional TransposeConvOptions transpose_conv_options = 174;
514 optional SparseToDenseOptions sparse_to_dense_options = 175;
515 optional PowOptions pow_options = 176;
516 optional ArgMinOptions argmin_options = 177;
517 // FakeQuantOptions 178
518 // BidirectionalSequenceLSTMOptions 179
519 // BidirectionalSequenceRNNOptions 180
520 // UnidirectionalSequenceLSTMOptions 181
521 optional RangeOptions range_options = 182;
522 optional ResizeNearestNeighborOptions resize_nearest_neighbor_options = 183;
523 optional LeakyReluOptions leaky_relu_options = 184;
524 optional MirrorPadOptions mirrorpad_options = 185;
525 optional UniqueOptions unique_options = 186;
526 optional ReverseV2Options reversev2_options = 187;
528 optional GatherNdOptions gather_nd_options = 189;
529 optional WhereOptions where_options = 190;
530 optional RankOptions rank_options = 191;
531 optional ReverseSequenceOptions reverse_sequence_options = 192;
532 optional MatrixDiagOptions matrix_diag_options = 193;
533 // QuantizeOptions 194
534 optional MatrixSetDiagOptions matrix_set_diag_options = 195;
535 // HardSwishOptions 196
536 optional DepthToSpaceOptions depth_to_space_options = 197;
537 // NonMaxSuppressionV4Options 198
538 // NonMaxSuppressionV5Options 199
539 optional ScatterNdOptions scatter_nd_options = 200;
540 optional NotEqualOptions notequal_options = 201;
541 optional ExpandDimsOptions expand_dims_options = 202;
542 optional Pool2DOptions l2pool2d_options = 203;
543 optional ReducerOptions all_options = 204;
544 optional ReducerOptions reduce_min_options = 205;
545 optional SegmentSumOptions segment_sum_options = 206;
546 optional AddNOptions add_n_options = 207;
547 optional MatMulOptions matmul_options = 208;
549 // NOTE if there are more than two options with same type of Options
550 // use the number not listed in the above reserve list
553 // For additional subgraphs
555 repeated Operand operand = 1;
556 repeated Operation operation = 2;
557 repeated string input = 3;
558 repeated string output = 4;
559 optional string name = 5;
562 message ModelRecipe {
563 repeated Operand operand = 1;
564 repeated Operation operation = 2;
565 repeated string input = 3;
566 repeated string output = 4;
567 optional string name = 5;
568 optional uint32 version = 6 [default = 1];
569 repeated Graph graph = 7;