catniff 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dtype.js +6 -1
- package/package.json +1 -1
package/dist/dtype.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TypedArray = exports.dtypeHiearchy = void 0;
|
|
4
|
+
// Compatibility check
|
|
5
|
+
const float16Supported = typeof Float16Array !== "undefined";
|
|
6
|
+
if (!float16Supported) {
|
|
7
|
+
console.log("Warning: Your JS runtime does not support Float16Array, falling back to Float32Array...");
|
|
8
|
+
}
|
|
4
9
|
exports.dtypeHiearchy = {
|
|
5
10
|
"float64": 8,
|
|
6
11
|
"float32": 7,
|
|
@@ -15,7 +20,7 @@ exports.dtypeHiearchy = {
|
|
|
15
20
|
exports.TypedArray = {
|
|
16
21
|
"float64": Float64Array,
|
|
17
22
|
"float32": Float32Array,
|
|
18
|
-
"float16": Float16Array,
|
|
23
|
+
"float16": float16Supported ? Float16Array : Float32Array,
|
|
19
24
|
"int32": Int32Array,
|
|
20
25
|
"int16": Int16Array,
|
|
21
26
|
"int8": Int8Array,
|