Skip to content

Commit

Permalink
Update circle-schema.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Sep 10, 2024
1 parent 24cffc2 commit 258431a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions source/circle-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
export const circle = {};

circle.TensorType = {
UINT4: -1,
FLOAT32: 0,
FLOAT16: 1,
INT32: 2,
Expand All @@ -20,7 +19,12 @@ circle.TensorType = {
VARIANT: 14,
UINT32: 15,
UINT16: 16,
INT4: 17
INT4: 17,
UINT4: -1,
GGML_Q4_0: -2,
GGML_Q4_1: -3,
GGML_Q8_0: -4,
GGML_Q8_1: -5
};

circle.CustomQuantization = class CustomQuantization {
Expand Down Expand Up @@ -210,6 +214,11 @@ circle.VariantSubType = class VariantSubType {
}
};

circle.CompressionType = {
NONE: 0,
HUFFMAN: 1
};

circle.Tensor = class Tensor {

static decode(reader, position) {
Expand All @@ -224,6 +233,7 @@ circle.Tensor = class Tensor {
$.shape_signature = reader.array(position, 18, Int32Array);
$.has_rank = reader.bool_(position, 20, false);
$.variant_tensors = reader.tables(position, 22, circle.VariantSubType);
$.compression_type = reader.int8_(position, 24, 0);
return $;
}

Expand All @@ -239,6 +249,7 @@ circle.Tensor = class Tensor {
$.shape_signature = reader.array(json.shape_signature, Int32Array);
$.has_rank = reader.value(json.has_rank, false);
$.variant_tensors = reader.objects(json.variant_tensors, circle.VariantSubType);
$.compression_type = circle.CompressionType[json.compression_type];
return $;
}
};
Expand Down

0 comments on commit 258431a

Please sign in to comment.