catniff 0.6.1 → 0.6.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/core.js +3 -3
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -507,11 +507,11 @@ class Tensor {
|
|
|
507
507
|
}
|
|
508
508
|
// Tensor indexing
|
|
509
509
|
index(indices) {
|
|
510
|
-
|
|
511
|
-
|
|
510
|
+
const tensorIndices = this.handleOther(indices).contiguous();
|
|
511
|
+
if (typeof tensorIndices.value === "number") {
|
|
512
|
+
return this.indexWithArray([tensorIndices.value]).squeeze(0);
|
|
512
513
|
}
|
|
513
514
|
else {
|
|
514
|
-
const tensorIndices = this.handleOther(indices).contiguous();
|
|
515
515
|
const originalShape = tensorIndices.shape;
|
|
516
516
|
const flatIndices = tensorIndices.value;
|
|
517
517
|
const result = this.indexWithArray(flatIndices);
|