Class XlaHostCompute

java.lang.Object
org.tensorflow.op.RawOp
org.tensorflow.op.xla.XlaHostCompute
All Implemented Interfaces:
Iterable<Operand<TType>>, Op

@Operator(group="xla") public final class XlaHostCompute extends RawOp implements Iterable<Operand<TType>>
A pseudo-op to represent host-side computation in an XLA program.
  • Field Details

  • Constructor Details

    • XlaHostCompute

      public XlaHostCompute(Operation operation)
  • Method Details

    • create

      @Endpoint(describeByClass=true) public static XlaHostCompute create(Scope scope, Iterable<Operand<?>> inputs, List<Class<? extends TType>> Toutputs, List<String> ancestors, List<Shape> shapes, ConcreteFunction shapeInferenceGraph, String key, XlaHostCompute.Options... options)
      Factory method to create a class wrapping a new XlaHostCompute operation.
      Parameters:
      scope - current scope
      inputs - A list of tensors that will be sent to the host.
      Toutputs - The element types of each element in outputs.
      ancestors - A list of names of HostCompute computations that must be sequenced before this computation.
      shapes - If shape_inference_graph is empty, a list of the shapes of outputs.
      shapeInferenceGraph - If non-empty, a serialized GraphDef representing a graph that must be analyzed at compile time to determine the shapes of the outputs.
      key - A unique identifier for this region used to match up host transfers.
      options - carries optional attribute values
      Returns:
      a new instance of XlaHostCompute
    • sendKey

      public static XlaHostCompute.Options sendKey(String sendKey)
      Sets the sendKey option.
      Parameters:
      sendKey - the sendKey option
      Returns:
      this Options instance.
    • recvKey

      public static XlaHostCompute.Options recvKey(String recvKey)
      Sets the recvKey option.
      Parameters:
      recvKey - the recvKey option
      Returns:
      this Options instance.
    • costEstimateNs

      public static XlaHostCompute.Options costEstimateNs(Long costEstimateNs)
      Sets the costEstimateNs option.
      Parameters:
      costEstimateNs - Estimated duration of the host computation in nanoseconds.
      Returns:
      this Options instance.
    • tpuCore

      public static XlaHostCompute.Options tpuCore(Long tpuCore)
      Sets the tpuCore option.
      Parameters:
      tpuCore - Default core to use for host to device transfers.
      Returns:
      this Options instance.
    • outputs

      public List<Output<?>> outputs()
      Gets outputs. A list of tensors that will be returned to the device.
      Returns:
      outputs.
    • iterator

      public Iterator<Operand<TType>> iterator()
      Specified by:
      iterator in interface Iterable<Operand<TType>>