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.
Files changed (2) hide show
  1. package/dist/core.js +3 -3
  2. 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
- if (typeof indices === "number") {
511
- return this.indexWithArray([indices]).squeeze(0);
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catniff",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "A small Torch-like deep learning framework for Javascript",
5
5
  "main": "index.js",
6
6
  "scripts": {