Skip to content

Commit

Permalink
add tensor.clone test
Browse files Browse the repository at this point in the history
  • Loading branch information
arition committed Oct 9, 2020
1 parent f0ef75b commit 8f60df0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/tensor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,11 @@ describe("Tensor creation", () => {
expect(t2).toThrow("Invalid argument");
expect(t3).toThrow("Invalid argument");
});

test("Tensor clone", () => {
const t = torch.rand(2, 3);
const tObject = t.toObject();
const tCloneObject = t.clone().toObject();
expect(tObject).toEqual(tCloneObject);
});
});

0 comments on commit 8f60df0

Please sign in to comment.