Class TypeCast
Defined in File transforms.h
Inheritance Relationships
Base Type
public mindspore::dataset::TensorTransform
(Class TensorTransform)
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.
Example/* 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.
-
explicit TypeCast(mindspore::DataType data_type)