U - data type for output() output@Operator public final class Bitcast<U> extends PrimitiveOp implements Operand<U>
Given a tensor `input`, this operation returns a tensor that has the same buffer data as `input` with datatype `type`.
If the input datatype `T` is larger than the output datatype `type` then the shape changes from [...] to [..., sizeof(`T`)/sizeof(`type`)].
If `T` is smaller than `type`, the operator requires that the rightmost dimension be equal to sizeof(`type`)/sizeof(`T`). The shape then goes from [..., sizeof(`type`)/sizeof(`T`)] to [...].
NOTE: Bitcast is implemented as a low-level cast, so machines with different endian orderings will give different results.
operation| Modifier and Type | Method and Description |
|---|---|
Output<U> |
asOutput()
Returns the symbolic handle of a tensor.
|
static <U,T> Bitcast<U> |
create(Scope scope,
Operand<T> input,
Class<U> type)
Factory method to create a class to wrap a new Bitcast operation to the graph.
|
Output<U> |
output() |
equals, hashCode, toStringpublic static <U,T> Bitcast<U> create(Scope scope, Operand<T> input, Class<U> type)
scope - current graph scopeinput - type - public Output<U> asOutput()
OperandInputs 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.
asOutput in interface Operand<U>OperationBuilder.addInput(Output)Copyright © 2015–2019. All rights reserved.