Back to Tensorflow

CastOp

tensorflow/lite/g3doc/api_docs/java/org/tensorflow/lite/support/common/ops/CastOp.html

2.21.03.2 KB
Original Source

public class CastOp

Casts a TensorBuffer to a specified data type.

Public Constructors

| | CastOp(DataType destinationType) Constructs a CastOp.

|

Public Methods

| TensorBuffer | apply(TensorBuffer input) |

Inherited Methods

From class java.lang.Object

| boolean | equals(Object arg0) | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

From interface org.tensorflow.lite.support.common.TensorOperator

| abstract TensorBuffer | apply(TensorBuffer input) |

From interface org.tensorflow.lite.support.common.Operator

| abstract TensorBuffer | apply(TensorBuffer x) Applies an operation on a T object, returning a T object.

|

Public Constructors

public CastOp (DataType destinationType)

Constructs a CastOp.

Note: For only converting type for a certain TensorBuffer on-the-fly rather than in a processor, please directly use TensorBuffer.createFrom(TensorBuffer, DataType).

When this Op is executed, if the original TensorBuffer is already in destinationType, the original buffer will be directly returned.

Parameters

| destinationType | The type of the casted TensorBuffer. |

Throws

| IllegalArgumentException | if destinationType is neither DataType.UINT8 nor DataType.FLOAT32. |

Public Methods

public TensorBuffer apply (TensorBuffer input)

Parameters

| input | |