Skip to content

Commit ca5d343

Browse files
committed
Remove printing from CustomGradientTest
Signed-off-by: Ryan Nett <[email protected]>
1 parent 9601138 commit ca5d343

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/CustomGradientTest.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,14 @@ public void testCustomGradient() {
5757

5858
Ops tf = Ops.create(g);
5959
Output<TFloat32> x = tf.placeholder(TFloat32.class).output();
60-
Output<TFloat32> y = tf.nn.nthElement(x, tf.constant(2)).asOutput();
60+
Output<TFloat32> y =
61+
tf.math.add(tf.nn.nthElement(x, tf.constant(2)), tf.constant(4f)).asOutput();
6162

6263
Output<?>[] grads0 = g.addGradients(y, toArray(x));
6364
assertNotNull(grads0);
6465
assertEquals(1, grads0.length);
6566
assertEquals(DataType.DT_FLOAT, grads0[0].dataType());
6667

67-
// System.out.println(
68-
// StreamSupport.stream(
69-
// Spliterators.spliteratorUnknownSize(
70-
// g.operations(), Spliterator.ORDERED | Spliterator.NONNULL),
71-
// false)
72-
// .map(GraphOperation::name)
73-
// .collect(Collectors.toList()));
74-
7568
try (TFloat32 c1 = TFloat32.vectorOf(3.0f, 2.0f, 1.0f, 0.0f);
7669
AutoCloseableList<Tensor> outputs =
7770
new AutoCloseableList<>(s.runner().feed(x, c1).fetch(grads0[0]).run())) {

0 commit comments

Comments
 (0)