Class DebugNumericsSummary<U extends TNumber>

java.lang.Object
org.tensorflow.op.RawOp
org.tensorflow.op.debugging.DebugNumericsSummary<U>
All Implemented Interfaces:
Shaped, Op, Operand<U>

public final class DebugNumericsSummary<U extends TNumber> extends RawOp implements Operand<U>
Debug Numeric Summary V2 Op. Computes a numeric summary of the input tensor. The shape of the output depends on the tensor_debug_mode attribute. This op is used internally by TensorFlow Debugger (tfdbg) v2.
  • Field Details

  • Constructor Details

    • DebugNumericsSummary

      public DebugNumericsSummary(Operation operation)
  • Method Details

    • create

      @Endpoint(describeByClass=true) public static <U extends TNumber> DebugNumericsSummary<U> create(Scope scope, Operand<? extends TType> input, Class<U> outputDtype, DebugNumericsSummary.Options... options)
      Factory method to create a class wrapping a new DebugNumericSummaryV2 operation.
      Type Parameters:
      U - data type for DebugNumericSummaryV2 output and operands
      Parameters:
      scope - current scope
      input - Input tensor, to be summarized by the op.
      outputDtype - Optional. The type of the output. Can be float32 or float64 (default: float32).
      options - carries optional attribute values
      Returns:
      a new instance of DebugNumericsSummary
    • create

      @Endpoint(describeByClass=true) public static DebugNumericsSummary<TFloat32> create(Scope scope, Operand<? extends TType> input, DebugNumericsSummary.Options[] options)
      Factory method to create a class wrapping a new DebugNumericSummaryV2 operation, with the default output types.
      Parameters:
      scope - current scope
      input - Input tensor, to be summarized by the op.
      options - carries optional attribute values
      Returns:
      a new instance of DebugNumericsSummary, with default output types
    • tensorDebugMode

      public static DebugNumericsSummary.Options tensorDebugMode(Long tensorDebugMode)
      Sets the tensorDebugMode option.
      Parameters:
      tensorDebugMode - Tensor debug mode: the mode in which the input tensor is summarized by the op. See the TensorDebugMode enum in tensorflow/core/protobuf/debug_event.proto for details.

      Supported values: 2 (CURT_HEALTH): Output a float32/64 tensor of shape [2]. The 1st element is the tensor_id, if provided, and -1 otherwise. The 2nd element is a bit which is set to 1 if the input tensor has an infinity or nan value, or zero otherwise.

      3 (CONCISE_HEALTH): Output a float32/64 tensor of shape [5]. The 1st element is the tensor_id, if provided, and -1 otherwise. The remaining four slots are the total number of elements, -infs, +infs, and nans in the input tensor respectively.

      4 (FULL_HEALTH): Output a float32/64 tensor of shape [11]. The 1st element is the tensor_id, if provided, and -1 otherwise. The 2nd element is the device_id, if provided, and -1 otherwise. The 3rd element holds the datatype value of the input tensor as according to the enumerated type in tensorflow/core/framework/types.proto. The remaining elements hold the total number of elements, -infs, +infs, nans, negative finite numbers, zeros, and positive finite numbers in the input tensor respectively.

      5 (SHAPE): Output a float32/64 tensor of shape [10]. The 1st element is the tensor_id, if provided, and -1 otherwise. The 2nd element holds the datatype value of the input tensor as according to the enumerated type in tensorflow/core/framework/types.proto. The 3rd element holds the rank of the tensor. The 4th element holds the number of elements within the tensor. Finally the remaining 6 elements hold the shape of the tensor. If the rank of the tensor is lower than 6, the shape is right padded with zeros. If the rank is greater than 6, the head of the shape is truncated.

      6 (FULL_NUMERICS): Output a float32/64 tensor of shape [22]. The 1st element is the tensor_id, if provided, and -1 otherwise. The 2nd element is the device_id, if provided, and -1 otherwise. The 3rd element holds the datatype value of the input tensor as according to the enumerated type in tensorflow/core/framework/types.proto. The 4th element holds the rank of the tensor. The 5th to 11th elements hold the shape of the tensor. If the rank of the tensor is lower than 6, the shape is right padded with zeros. If the rank is greater than 6, the head of the shape is truncated. The 12th to 18th elements hold the number of elements, -infs, +infs, nans, denormal floats, negative finite numbers, zeros, and positive finite numbers in the input tensor respectively. The final four elements hold the min value, max value, mean, and variance of the input tensor.

      8 (REDUCE_INF_NAN_THREE_SLOTS): Output a float32/64 tensor of shape [3]. The 1st element is -inf if any elements of the input tensor is -inf, or zero otherwise. The 2nd element is +inf if any elements of the input tensor is +inf, or zero otherwise. The 3rd element is nan if any element of the input tensor is nan, or zero otherwise.

      Returns:
      this Options instance.
    • tensorId

      public static DebugNumericsSummary.Options tensorId(Long tensorId)
      Sets the tensorId option.
      Parameters:
      tensorId - Optional. An integer identifier for the tensor being summarized by this op.
      Returns:
      this Options instance.
    • output

      public Output<U> output()
      Gets output.
      Returns:
      output.
    • asOutput

      public Output<U> asOutput()
      Description copied from interface: Operand
      Returns the symbolic handle of the tensor.

      Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.

      Specified by:
      asOutput in interface Operand<U extends TNumber>
      See Also: