Skip to content

Commit

Permalink
Update tflite.js (#1292)
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Jun 13, 2024
1 parent 0c497db commit 889bc3d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion source/circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,9 @@ circle.Tensor = class {
circle.TensorType = class {

constructor(tensor, denotation) {
const shape = tensor.shape_signature && tensor.shape_signature.length > 0 ? tensor.shape_signature : tensor.shape;
this.dataType = circle.Utility.dataType(tensor.type);
this.shape = new circle.TensorShape(Array.from(tensor.shape || []));
this.shape = new circle.TensorShape(Array.from(shape || []));
this.denotation = denotation;
}

Expand Down
3 changes: 2 additions & 1 deletion source/tflite.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,9 @@ tflite.Tensor = class {
tflite.TensorType = class {

constructor(tensor, denotation) {
const shape = tensor.shape_signature && tensor.shape_signature.length > 0 ? tensor.shape_signature : tensor.shape;
this.dataType = tflite.Utility.dataType(tensor.type);
this.shape = new tflite.TensorShape(Array.from(tensor.shape || []));
this.shape = new tflite.TensorShape(Array.from(shape || []));
this.denotation = denotation;
}

Expand Down
2 changes: 1 addition & 1 deletion source/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,7 @@ view.Value = class {
type.shape.dimensions &&
type.shape.dimensions.length > 0 &&
type.shape.dimensions.every((dim) => !dim || Number.isInteger(dim) || typeof dim === 'bigint' || (typeof dim === 'string'))) {
content = type.shape.dimensions.map((dim) => (dim !== null && dim !== undefined) ? dim : '?').join('\u00D7');
content = type.shape.dimensions.map((dim) => (dim !== null && dim !== undefined && dim !== -1) ? dim : '?').join('\u00D7');
content = content.length > 16 ? '' : content;
}
if (this.context.options.names) {
Expand Down

0 comments on commit 889bc3d

Please sign in to comment.