wkcn commented on a change in pull request #15921: dynamic custom operator 
support
URL: https://github.com/apache/incubator-mxnet/pull/15921#discussion_r331326421
 
 

 ##########
 File path: include/mxnet/lib_api.h
 ##########
 @@ -18,33 +18,756 @@
  */
 
 /*!
- * Copyright (c) 2015 by Contributors
+ * Copyright (c) 2019 by Contributors
  * \file lib_api.h
  * \brief APIs to interact with libraries
+ * This API specifies function prototypes to
+ * register custom ops for library authors
  */
+
 #ifndef MXNET_LIB_API_H_
 #define MXNET_LIB_API_H_
 
+#include <stdint.h>
+#include <stdlib.h>
+#include <vector>
+#include <map>
+#include <string>
+#include <iostream>
+#include <utility>
+
+#define MX_LIBRARY_VERSION 1
+
+/*!
+ * \brief External Tensor data types
+ */
+enum MXDType {
+  kFloat32 = 0,
+  kFloat64 = 1,
+  kFloat16 = 2,
+  kUint8 = 3,
+  kInt32 = 4,
+  kInt8  = 5,
+  kInt64 = 6,
+};
+
+enum MXReturnValue {
+  MX_FAIL = 0,
+  MX_SUCCESS = 1,
+};
+
+/*!
+ * \brief External Tensor data structure
+ */
+struct MXTensor {
+  MXTensor() : data(NULL) {}
+
+  MXTensor(void *data, const std::vector<int64_t> &shape, MXDType dtype)
+  : data(data), shape(shape), dtype(dtype) {}
+
+  /*! \brief helper function to cast data pointer */
+  template<typename data_type>
+  inline data_type* getData() {
 
 Review comment:
   Agree : )

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to