Skip to content

Commit 4acd791

Browse files
authored
Update tensor unit tests
1 parent 02b81dd commit 4acd791

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tests/utils/tensor.test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,14 @@ describe("Tensor operations", () => {
6262

6363
it("should return a range of rows", async () => {
6464
const t1 = new Tensor("float32", [1, 2, 3, 4, 5, 6], [3, 2]);
65-
// The end index is not included.
6665
const t2 = t1.slice([1, 3]);
6766
const target = new Tensor("float32", [3, 4, 5, 6], [2, 2]);
6867

6968
compare(t2, target);
7069
});
7170

7271
it("should return a crop", async () => {
73-
// Create 21 nodes.
74-
const t1 = new Tensor("float32", Array.from({ length: 28 }, (v, i) => v = ++i), [4, 7]);
72+
const t1 = new Tensor("float32", Array.from({ length: 28 }, (_, i) => i + 1), [4, 7]);
7573
const t2 = t1.slice([1, -1], [1, -1]);
7674

7775
const target = new Tensor("float32", [9, 10, 11, 12, 13, 16, 17, 18, 19, 20], [2, 5]);

0 commit comments

Comments
 (0)