(self)
| 135 | ]) |
| 136 | |
| 137 | def testBasic(self): |
| 138 | matmul = def_function.function(math_ops.matmul) |
| 139 | t = constant_op.constant([[1.0, 2.0], [3.0, 4.0]]) |
| 140 | sq = matmul(t, t, transpose_a=True) |
| 141 | sq2 = matmul(sq, t, transpose_a=True) |
| 142 | self.assertAllEqual(sq.numpy().reshape(-1), [10, 14, 14, 20]) |
| 143 | self.assertAllEqual(sq2.numpy().reshape(-1), [52, 76, 74, 108]) |
| 144 | |
| 145 | def testVariable(self): |
| 146 | v1 = variables.Variable(1.0) |