Class ToNumber

Inheritance Relationships

Base Type

Class Documentation

class ToNumber : public mindspore::dataset::TensorTransform

Convert every element in a string tensor to a number. Strings are cast according to the rules specified in the following links: https://en.cppreference.com/w/cpp/string/basic_string/stof, https://en.cppreference.com/w/cpp/string/basic_string/stoul, except that any strings which represent negative numbers cannot be cast to an unsigned integer type.

Public Functions

explicit ToNumber(mindspore::DataType data_type)

Constructor.

Parameters

data_type[in] mindspore::DataType of the tensor to be cast to. Must be a numeric type, excluding bool.

~ToNumber() = default

Destructor.