Method Cast
Cast(Tensor, DataType)
Computes the output tensor using an element-wise Cast
function: f(x) = (float)x or f(x) = (int)x depending on the value of toType
.
Declaration
public Tensor Cast(Tensor X, DataType toType)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | The input tensor. |
DataType | toType | The data type to cast to as a |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |