  @Test
  public void setAttrShape() {

    try (Graph g = new Graph()) {
      Output<?> n =
          g.opBuilder("Placeholder", "unknown")
              .setAttr("dtype", TFloat32.DTYPE)
              .setAttr("shape", Shape.unknown())
              .build()
              .output(0);
      assertEquals(-1, n.shape().numDimensions());
      assertEquals(TFloat32.DTYPE, n.dataType());

      n =
          g.opBuilder("Placeholder", "batch_of_vectors")
              .setAttr("dtype", TFloat32.DTYPE)
              .setAttr("shape", Shape.of(-1, 784))
              .build()
              .output(0);
      assertEquals(2, n.shape().numDimensions());
      assertEquals(-1, n.shape().size(0));
      assertEquals(784, n.shape().size(1));
      assertEquals(TFloat32.DTYPE, n.dataType());
    }
  }