@@ -58,41 +58,41 @@ NNFW_LAYOUT getLayout(const char *layout)
5858 throw NnfwError (std::string (" Unknown layout type: '" ) + layout + " '" );
5959}
6060
61- datatype::datatype (NNFW_TYPE type) : nnfw_type (type)
61+ datatype::datatype (NNFW_TYPE type) : _nnfw_type (type)
6262{
6363 switch (type)
6464 {
6565 case NNFW_TYPE::NNFW_TYPE_TENSOR_FLOAT32:
66- py_dtype = py::dtype (" float32" );
67- name = " float32" ;
66+ _py_dtype = py::dtype (" float32" );
67+ _name = " float32" ;
6868 return ;
6969 case NNFW_TYPE::NNFW_TYPE_TENSOR_INT32:
70- py_dtype = py::dtype (" int32" );
71- name = " int32" ;
70+ _py_dtype = py::dtype (" int32" );
71+ _name = " int32" ;
7272 return ;
7373 case NNFW_TYPE::NNFW_TYPE_TENSOR_QUANT8_ASYMM:
74- py_dtype = py::dtype (" uint8" );
75- name = " quint8" ;
74+ _py_dtype = py::dtype (" uint8" );
75+ _name = " quint8" ;
7676 return ;
7777 case NNFW_TYPE::NNFW_TYPE_TENSOR_UINT8:
78- py_dtype = py::dtype (" uint8" );
79- name = " uint8" ;
78+ _py_dtype = py::dtype (" uint8" );
79+ _name = " uint8" ;
8080 return ;
8181 case NNFW_TYPE::NNFW_TYPE_TENSOR_BOOL:
82- py_dtype = py::dtype (" bool" );
83- name = " bool" ;
82+ _py_dtype = py::dtype (" bool" );
83+ _name = " bool" ;
8484 return ;
8585 case NNFW_TYPE::NNFW_TYPE_TENSOR_INT64:
86- py_dtype = py::dtype (" int64" );
87- name = " int64" ;
86+ _py_dtype = py::dtype (" int64" );
87+ _name = " int64" ;
8888 return ;
8989 case NNFW_TYPE::NNFW_TYPE_TENSOR_QUANT8_ASYMM_SIGNED:
90- py_dtype = py::dtype (" int8" );
91- name = " qint8" ;
90+ _py_dtype = py::dtype (" int8" );
91+ _name = " qint8" ;
9292 return ;
9393 case NNFW_TYPE::NNFW_TYPE_TENSOR_QUANT16_SYMM_SIGNED:
94- py_dtype = py::dtype (" int16" );
95- name = " qint16sym" ;
94+ _py_dtype = py::dtype (" int16" );
95+ _name = " qint16sym" ;
9696 return ;
9797 }
9898 // This code should not be reached because compiler will generate a warning
@@ -154,7 +154,7 @@ void NNFW_SESSION::close_session()
154154void NNFW_SESSION::set_input_tensorinfo (uint32_t index, const tensorinfo *tensor_info)
155155{
156156 nnfw_tensorinfo ti;
157- ti.dtype = tensor_info->dtype .nnfw_type ;
157+ ti.dtype = tensor_info->dtype .nnfw_type () ;
158158 ti.rank = tensor_info->rank ;
159159 for (int i = 0 ; i < NNFW_MAX_RANK; i++)
160160 {
@@ -236,8 +236,8 @@ py::array NNFW_SESSION::get_output(uint32_t index)
236236
237237 const auto dtype = datatype (out_info.dtype );
238238 // Wrap the raw buffer in a numpy array;
239- py::array arr (dtype.py_dtype , shape);
240- std::memcpy (arr.mutable_data (), out_buffer, num_elements * dtype.py_dtype . itemsize ());
239+ py::array arr (dtype.py_dtype () , shape);
240+ std::memcpy (arr.mutable_data (), out_buffer, num_elements * dtype.itemsize ());
241241 arr.attr (" flags" ).attr (" writeable" ) = false ;
242242
243243 return arr;
0 commit comments