forked from mindspore-Ecosystem/mindspore
fix API C++
This commit is contained in:
parent
0e4d2c2535
commit
fce34b0213
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* Unless required by applicable law or agreed in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
|
@ -46,7 +46,7 @@ typedef struct {
|
|||
DeviceType type; /**< device type */
|
||||
} DeviceContext;
|
||||
|
||||
/// \brief Context defined for holding some environment for runtime.
|
||||
/// \brief Context defined for holding environment variables during runtime.
|
||||
class MS_API Context {
|
||||
public:
|
||||
/// \brief Constructor of MindSpore Lite Context using default value for parameters.
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
namespace mindspore {
|
||||
namespace lite {
|
||||
/// \brief STATUS defined error code in MindSpore Lite.
|
||||
/// \brief STATUS defined for holding error code in MindSpore Lite.
|
||||
using STATUS = int;
|
||||
|
||||
/* Success */
|
||||
|
@ -31,7 +31,7 @@ constexpr int RET_NULL_PTR = -2; /**< NULL pointer returned.*/
|
|||
constexpr int RET_PARAM_INVALID = -3; /**< Invalid parameter.*/
|
||||
constexpr int RET_NO_CHANGE = -4; /**< No change. */
|
||||
constexpr int RET_SUCCESS_EXIT = -5; /**< No error but exit. */
|
||||
constexpr int RET_MEMORY_FAILED = -6; /**< Create memory failed. */
|
||||
constexpr int RET_MEMORY_FAILED = -6; /**< Fail to create memory. */
|
||||
|
||||
/* Executor error code, range: [-101,-200] */
|
||||
constexpr int RET_OUT_OF_TENSOR_RANGE = -101; /**< Failed to check range. */
|
||||
|
@ -52,7 +52,7 @@ constexpr int RET_FORMAT_ERR = -401; /**< Failed to checking tensor format. */
|
|||
|
||||
/* InferShape error code, range: [-501,-600] */
|
||||
constexpr int RET_INFER_ERR = -501; /**< Failed to infer shape. */
|
||||
constexpr int RET_INFER_INVALID = -502; /**< Invalid to infer shape before runtime. */
|
||||
constexpr int RET_INFER_INVALID = -502; /**< Invalid infer shape before runtime. */
|
||||
} // namespace lite
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
@ -50,14 +50,14 @@ class MS_API LiteSession {
|
|||
/// \brief Destructor of MindSpore Lite LiteSession.
|
||||
virtual ~LiteSession() = default;
|
||||
|
||||
/// \brief Try to bind or unbind threads in the thread pool to the specified cpu core.
|
||||
/// \brief Attempt to bind or unbind threads in the thread pool to or from the specified cpu core.
|
||||
///
|
||||
/// \param[in] if_bind Define whether to bind or unbind threads.
|
||||
virtual void BindThread(bool if_bind) = 0;
|
||||
|
||||
/// \brief Compile MindSpore Lite model.
|
||||
///
|
||||
/// \note CompileGraph should called before RunGraph.
|
||||
/// \note CompileGraph should be called before RunGraph.
|
||||
///
|
||||
/// \param[in] model Define the model to be compiled.
|
||||
///
|
||||
|
@ -78,10 +78,10 @@ class MS_API LiteSession {
|
|||
|
||||
/// \brief Run session with callback.
|
||||
///
|
||||
/// \param[in] before Define a call_back_function called before running each node.
|
||||
/// \param[in] before Define a call_back_function to be called before running each node.
|
||||
/// \param[in] after Define a call_back_function called after running each node.
|
||||
///
|
||||
/// \note RunGraph should called after CompileGraph.
|
||||
/// \note RunGraph should be called after CompileGraph.
|
||||
///
|
||||
/// \return STATUS as an error code of running graph, STATUS is defined in errorcode.h.
|
||||
virtual int RunGraph(const KernelCallBack &before = nullptr, const KernelCallBack &after = nullptr) = 0;
|
||||
|
|
|
@ -101,7 +101,7 @@ class MS_API ModelBuilder {
|
|||
/// \param[in] op Define the primitive to be added.
|
||||
/// \param[in] inputs Define input edge of primitive to be added.
|
||||
///
|
||||
/// \return ID of the primitive added.
|
||||
/// \return ID of the added primitive.
|
||||
virtual std::string AddOp(const lite::Primitive &op, const std::vector<OutEdge> &inputs) = 0;
|
||||
|
||||
/// \brief Finish constructing the model.
|
||||
|
|
|
@ -38,7 +38,7 @@ class MS_API MSTensor {
|
|||
/// \param[in] data_type Define data type of tensor to be created.
|
||||
/// \param[in] shape Define Shape of tensor to be created.
|
||||
///
|
||||
/// \note TypeId is defined in mindspore/mindspore/core/ir/dtype/type_id.h. Only number types in TypeId enum is
|
||||
/// \note TypeId is defined in mindspore/mindspore/core/ir/dtype/type_id.h. Only number types in TypeId enum are
|
||||
/// suitable for MSTensor.
|
||||
///
|
||||
/// \return the pointer of MSTensor.
|
||||
|
@ -49,7 +49,7 @@ class MS_API MSTensor {
|
|||
|
||||
/// \brief Get data type of the MindSpore Lite MSTensor.
|
||||
///
|
||||
/// \note TypeId is defined in mindspore/mindspore/core/ir/dtype/type_id.h. Only number types in TypeId enum is
|
||||
/// \note TypeId is defined in mindspore/mindspore/core/ir/dtype/type_id.h. Only number types in TypeId enum are
|
||||
/// suitable for MSTensor.
|
||||
///
|
||||
/// \return MindSpore Lite TypeId of the MindSpore Lite MSTensor.
|
||||
|
@ -57,7 +57,7 @@ class MS_API MSTensor {
|
|||
|
||||
/// \brief Set data type for the MindSpore Lite MSTensor.
|
||||
///
|
||||
/// \param[in] data_type Define MindSpore Lite TypeId to be set into the MindSpore Lite MSTensor.
|
||||
/// \param[in] data_type Define MindSpore Lite TypeId to be set in the MindSpore Lite MSTensor.
|
||||
///
|
||||
/// \return MindSpore Lite TypeId of the MindSpore Lite MSTensor after set.
|
||||
virtual TypeId set_data_type(TypeId data_type) = 0;
|
||||
|
@ -98,7 +98,7 @@ class MS_API MSTensor {
|
|||
|
||||
/// \brief Get the pointer of data in MSTensor.
|
||||
///
|
||||
/// \note The data pointer can be used to both write or read data in MSTensor.
|
||||
/// \note The data pointer can be used to both write and read data in MSTensor.
|
||||
///
|
||||
/// \return the pointer points to data in MSTensor.
|
||||
virtual void *MutableData() const = 0;
|
||||
|
|
Loading…
Reference in New Issue