|
339 | 339 | " \"`test` that `a==b` and are same type\"\n", |
340 | 340 | " test_eq(a,b)\n", |
341 | 341 | " test_eq(type(a),type(b))\n", |
342 | | - " if isinstance(a,(list,tuple)): test_eq(map(type,a),map(type,b)) # type of each element\n", |
343 | | - " if isinstance(a, (torch.Tensor, pd.Series, np.ndarray)): test_eq(a.dtype, b.dtype) # dtypes of both tensors" |
| 342 | + " if isinstance(a,(list,tuple)): test_eq(map(type,a),map(type,b))" |
344 | 343 | ] |
345 | 344 | }, |
346 | 345 | { |
|
355 | 354 | "test_fail(lambda: test_eq_type(1,1.))\n", |
356 | 355 | "test_eq_type([1,1],[1,1])\n", |
357 | 356 | "test_fail(lambda: test_eq_type([1,1],(1,1)))\n", |
358 | | - "test_fail(lambda: test_eq_type([1,1],[1,1.]))\n", |
359 | | - "test_fail(lambda: test_eq_type(torch.zeros(10), torch.zeros(10, dtype=torch.float64)))\n", |
360 | | - "test_fail(lambda: test_eq_type(torch.zeros(10), np.zeros(10)))\n", |
361 | | - "test_eq_type(torch.zeros(3), torch.Tensor([0, 0, 0]))" |
| 357 | + "test_fail(lambda: test_eq_type([1,1],[1,1.]))" |
362 | 358 | ] |
363 | 359 | }, |
364 | 360 | { |
|
0 commit comments