Class TypeCast

Inheritance Relationships

Base Type

Class Documentation

class TypeCast : public mindspore::dataset::TensorTransform

Cast the MindSpore data type of a tensor to another.

Public Functions

explicit TypeCast(mindspore::DataType data_type)

Constructor.

Parameters

data_type[in] mindspore::DataType to be cast to.

样例
/* Define operations */
auto typecast_op = transforms::TypeCast(mindspore::DataType::kNumberTypeUInt8);

/* dataset is an instance of Dataset object */
dataset = dataset->Map({typecast_op},      // operations
                       {"column"});        // input columns
~TypeCast() = default

Destructor.