| 505 | |
| 506 | @test_util.assert_no_new_pyobjects_executing_eagerly |
| 507 | def testTensorDir(self): |
| 508 | t = array_ops.zeros(1) |
| 509 | t.test_attr = "Test" |
| 510 | |
| 511 | instance_dir = dir(t) |
| 512 | type_dir = dir(ops.EagerTensor) |
| 513 | |
| 514 | # Monkey patched attributes should show up in dir(t) |
| 515 | self.assertIn("test_attr", instance_dir) |
| 516 | instance_dir.remove("test_attr") |
| 517 | self.assertEqual(instance_dir, type_dir) |
| 518 | |
| 519 | def testNonRectangularPackAsConstant(self): |
| 520 | l = [array_ops.zeros((10, 1)).numpy(), array_ops.zeros(1).numpy()] |