Class SchemaObj
Defined in File datasets.h
Class Documentation
-
class SchemaObj
Public Functions
-
inline explicit SchemaObj(const std::string &schema_file = "")
Constructor.
-
~SchemaObj() = default
Destructor.
-
inline Status add_column(const std::string &name, mindspore::DataType ms_type)
Add new column to the schema with unknown shape of rank 1.
- Parameters
name – [in] Name of the column.
ms_type – [in] Data type of the column(mindspore::DataType).
- Returns
Status code
-
inline Status add_column(const std::string &name, const std::string &ms_type)
Add new column to the schema with unknown shape of rank 1.
- Parameters
name – [in] Name of the column.
ms_type – [in] Data type of the column(std::string).
shape – [in] Shape of the column.
- Returns
Status code
-
inline Status add_column(const std::string &name, mindspore::DataType ms_type, const std::vector<int32_t> &shape)
Add new column to the schema.
- Parameters
name – [in] Name of the column.
ms_type – [in] Data type of the column(mindspore::DataType).
shape – [in] Shape of the column.
- Returns
Status code
-
inline Status add_column(const std::string &name, const std::string &ms_type, const std::vector<int32_t> &shape)
Add new column to the schema.
- Parameters
name – [in] Name of the column.
ms_type – [in] Data type of the column(std::string).
shape – [in] Shape of the column.
- Returns
Status code
-
inline std::string to_json()
Get a JSON string of the schema.
- Returns
JSON string of the schema
-
inline std::string to_string()
Get a JSON string of the schema.
-
void set_dataset_type(const std::string &dataset_type)
Set a new value to dataset_type.
-
void set_num_rows(int32_t num_rows)
Set a new value to num_rows.
-
int32_t get_num_rows() const
Get the current num_rows.
-
inline explicit SchemaObj(const std::string &schema_file = "")