(self)
| 64 | class GradientsTest(test_util.TensorFlowTestCase, parameterized.TestCase): |
| 65 | |
| 66 | def testGradients(self): |
| 67 | with ops.Graph().as_default(): |
| 68 | inp = constant(1.0, shape=[32, 100], name="in") |
| 69 | w = constant(1.0, shape=[100, 10], name="w") |
| 70 | b = constant(1.0, shape=[10], name="b") |
| 71 | xw = math_ops.matmul(inp, w, name="xw") |
| 72 | h = bias_add(xw, b, name="h") |
| 73 | w_grad = gradients.gradients(h, w)[0] |
| 74 | self.assertEquals("MatMul", w_grad.op.type) |
| 75 | self.assertEquals(w_grad.op._original_op, xw.op) |
| 76 | self.assertTrue(w_grad.op.get_attr("transpose_a")) |
| 77 | self.assertFalse(w_grad.op.get_attr("transpose_b")) |
| 78 | |
| 79 | def testUnusedOutput(self): |
| 80 | with ops.Graph().as_default(): |
nothing calls this directly
no test coverage detected