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. - 参数
- name – [in] Name of the column. 
- ms_type – [in] Data type of the column(mindspore::DataType). 
 
- 返回
- 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. - 参数
- name – [in] Name of the column. 
- ms_type – [in] Data type of the column(std::string). 
- shape – [in] Shape of the column. 
 
- 返回
- 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. - 参数
- name – [in] Name of the column. 
- ms_type – [in] Data type of the column(mindspore::DataType). 
- shape – [in] Shape of the column. 
 
- 返回
- 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. - 参数
- name – [in] Name of the column. 
- ms_type – [in] Data type of the column(std::string). 
- shape – [in] Shape of the column. 
 
- 返回
- Status code 
 
 - 
inline std::string to_json()
- Get a JSON string of the schema. - 返回
- 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 = "")