### Question:
EagerOperationBuilder implements OperationBuilder { @Override public EagerOperationBuilder setDevice(String device) { setDevice(opHandle, device); return this; } EagerOperationBuilder(EagerSession session, String type, String name); @Override EagerOperation build(); @Override EagerOperationBuilder addInput(Output<?> input); @Override EagerOperationBuilder addInputList(Output<?>[] inputs); @Override OperationBuilder addControlInput(Operation control); @Override EagerOperationBuilder setDevice(String device); @Override EagerOperationBuilder setAttr(String name, String value); @Override EagerOperationBuilder setAttr(String name, String[] values); @Override EagerOperationBuilder setAttr(String name, byte[] values); @Override EagerOperationBuilder setAttr(String name, long value); @Override EagerOperationBuilder setAttr(String name, long[] values); @Override EagerOperationBuilder setAttr(String name, float value); @Override EagerOperationBuilder setAttr(String name, float[] values); @Override EagerOperationBuilder setAttr(String name, boolean value); @Override EagerOperationBuilder setAttr(String name, boolean[] values); @Override EagerOperationBuilder setAttr(String name, DataType<?> value); @Override EagerOperationBuilder setAttr(String name, DataType<?>[] values); @Override EagerOperationBuilder setAttr(String name, Tensor<?> value); @Override EagerOperationBuilder setAttr(String name, Tensor<?>[] values); @Override EagerOperationBuilder setAttr(String name, Shape value); @Override EagerOperationBuilder setAttr(String name, Shape[] values);  }### Answer:
@Test public void setDevice() { try (EagerSession session = EagerSession.create()) { Ops tf = Ops.create(session); opBuilder(session, "Add", "SetDevice") .setDevice("/job:localhost/replica:0/task:0/device:CPU:0") .addInput(tf.constant(2).asOutput()) .addInput(tf.constant(4).asOutput()) .build(); } }