From 8f60df0b39d0405ecffae0ac579b5d10e8aa215d Mon Sep 17 00:00:00 2001 From: arition Date: Thu, 8 Oct 2020 19:04:22 -0700 Subject: [PATCH] add tensor.clone test --- tests/tensor.test.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/tensor.test.js b/tests/tensor.test.js index a89c426..035b24e 100644 --- a/tests/tensor.test.js +++ b/tests/tensor.test.js @@ -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); + }); });