Skip to content

Commit

Permalink
[nnpackage] Update circle schema to 0.6 (Samsung#11382)
Browse files Browse the repository at this point in the history
This commit updates schema to support more ops and options.

ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]>
Co-authored-by: SaeHie Park <[email protected]>
  • Loading branch information
hseok-oh and seanshpark authored Aug 31, 2023
1 parent 2cb3063 commit b033179
Showing 1 changed file with 53 additions and 3 deletions.
56 changes: 53 additions & 3 deletions nnpackage/schema/circle_schema.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
// Version 0.3: SHUFFLED16x1FLOAT32 is added.
// Version 0.4: Base up to TensorFlow Lite v2.7.0 schema.
// Version 0.5: Base up to TensorFlow Lite v2.10.1 schema.
// Version 0.6: Base up to TensorFlow Lite v2.13.0 schema.

namespace circle;

Expand Down Expand Up @@ -62,7 +63,8 @@ enum TensorType : byte {
RESOURCE = 13,
VARIANT = 14,
UINT32 = 15,
UINT16 = 16
UINT16 = 16,
INT4 = 17,
}

// Custom quantization parameters for experimenting with new quantization
Expand Down Expand Up @@ -202,6 +204,16 @@ table SparsityParameters {
dim_metadata:[DimensionMetadata];
}

// The nested tensor type for VARIANT type.
table VariantSubType {
// The tensor shape.
shape:[int];
type:TensorType;
// If false, the rank or the number of tensor dimensions is unknown.
// If false, "shape" must be [].
has_rank: bool = false;
}

table Tensor {
// The tensor shape. The meaning of each entry is operator-specific but
// builtin ops use: [batch size, height, width, number of channels] (That's
Expand Down Expand Up @@ -233,6 +245,12 @@ table Tensor {
// If false, the rank or the number of tensor dimensions is unknown.
// If false, "shape" must be [].
has_rank: bool = false;

// The nested Tensor types for VARIANT type. This is always empty for
// non-VARIANT types. This is optional because the nested type can be omitted.
// Currently only 1 subtype is supported. The field is defined as an array for
// flexibility of supporting multiple subtypes in the future.
variant_tensors:[VariantSubType];
}

// A list of builtin operators. Builtin operators are slightly faster than custom
Expand Down Expand Up @@ -406,7 +424,12 @@ enum BuiltinOperator : int32 {
UNSORTED_SEGMENT_PROD = 153,
UNSORTED_SEGMENT_MAX = 154,
UNSORTED_SEGMENT_SUM = 155,
ATAN2 = 156
ATAN2 = 156,
UNSORTED_SEGMENT_MIN = 157,
SIGN = 158,
BITCAST = 159,
BITWISE_XOR = 160,
RIGHT_SHIFT = 161,
}
// LINT.ThenChange(nnapi_linter/linter.proto)

Expand Down Expand Up @@ -531,8 +554,13 @@ union BuiltinOptions {
DynamicUpdateSliceOptions,
UnsortedSegmentProdOptions,
UnsortedSegmentMaxOptions,
UnsortedSegmentMinOptions,
UnsortedSegmentSumOptions,
ATan2Options,
SignOptions,
BitcastOptions,
BitwiseXorOptions,
RightShiftOptions,
BCQGatherOptions = 252,
BCQFullyConnectedOptions = 253,
InstanceNormOptions = 254,
Expand Down Expand Up @@ -727,8 +755,11 @@ table UnidirectionalSequenceLSTMOptions {
// If true then first dimension is sequence, otherwise batch.
time_major:bool;

// Parameter for Unidirectional Sequence LSTM version 4.
// Parameter for Unidirectional Sequence LSTM version 3.
asymmetric_quantize_inputs:bool;

// Parameter for unidirectional sequence RNN version 4.
diagonal_recurrent_tensors:bool;
}

table BidirectionalSequenceLSTMOptions {
Expand Down Expand Up @@ -907,9 +938,13 @@ table SliceOptions {
}

table TransposeConvOptions {
// Parameters supported by version 1, 2, 3:
padding:Padding;
stride_w:int;
stride_h:int;

// Parameters supported by version 4:
fused_activation_function:ActivationFunctionType = NONE;
}

table ExpandDimsOptions {
Expand Down Expand Up @@ -1150,6 +1185,21 @@ table UnsortedSegmentSumOptions {
table ATan2Options {
}

table UnsortedSegmentMinOptions{
}

table SignOptions {
}

table BitcastOptions {
}

table BitwiseXorOptions {
}

table RightShiftOptions {
}

table BCQGatherOptions {
input_hidden_size: int;
axis: int;
Expand Down

0 comments on commit b033179

Please sign in to comment.