Skip to content

Commit

Permalink
Update view.js (#1240)
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Aug 6, 2024
1 parent f75b7bd commit 80478af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -5069,7 +5069,9 @@ metrics.Tensor = class {
const type = this._tensor.type;
const shape = type.shape.dimensions;
const size = shape.reduce((a, b) => a * b, 1);
if (type.dataType.startsWith('float') && size < 0x800000 && (!keys.has('sparsity') || !keys.has('min') || !keys.has('max') && !keys.has('mean') || !keys.has('max') || !keys.has('std'))) {
if (size < 0x800000 &&
(type.dataType.startsWith('float') || type.dataType.startsWith('bfloat')) &&
(!keys.has('sparsity') || !keys.has('min') || !keys.has('max') && !keys.has('mean') || !keys.has('max') || !keys.has('std'))) {
const data = this._tensor.value;
let zeros = 0;
let min = null;
Expand Down

0 comments on commit 80478af

Please sign in to comment.