[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-08 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r312257297
 
 

 ##
 File path: src/c_api/c_api.cc
 ##
 @@ -537,20 +557,18 @@ int MXNDArrayGetShape(NDArrayHandle handle,
   API_END();
 }
 
-int MXNDArrayGetShapeEx(NDArrayHandle handle,
-int *out_dim,
-const int **out_pdata) {
-  MXAPIThreadLocalEntry *ret = MXAPIThreadLocalStore::Get();
-  API_BEGIN();
-  NDArray *arr = static_cast(handle);
+template
+inline void GetShape(NDArrayHandle handle, const dtype** out_pdata, int* 
out_dim,
 
 Review comment:
   CreateNDArrayImpl is not correct naming altogether. There is no point of 
calling it CreateNDArrayImpl naming should make sense with what is written 
inside of the function. Impl implies implementation. We are not implementing 
anything in that function, we are simply calling constructor to create NDArray. 
I am ok to revert CreateNDArrayImpl -> CreateNDArray. That makes more sense to 
me. @apeforest do you think this makes sense ?


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-08 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r312252404
 
 

 ##
 File path: python/mxnet/runtime.py
 ##
 @@ -69,12 +69,18 @@ def feature_list():
 features = [lib_features_c_array[i] for i in 
range(lib_features_size.value)]
 return features
 
+
 class Features(collections.OrderedDict):
 """
 OrderedDict of name to Feature
 """
+feature_dict = None
 
 Review comment:
   @apeforest ^


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-08 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r312252305
 
 

 ##
 File path: python/mxnet/runtime.py
 ##
 @@ -69,12 +69,18 @@ def feature_list():
 features = [lib_features_c_array[i] for i in 
range(lib_features_size.value)]
 return features
 
+
 class Features(collections.OrderedDict):
 """
 OrderedDict of name to Feature
 """
+feature_dict = None
 
 Review comment:
   What is the concern here ? I don't see the harm of keeing it here. I will 
change it to singleton but caching results in individual files seems a 
makeshift approach. I would still prefer to keep it here for now till singleton 
is implemented 


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-08 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r312252305
 
 

 ##
 File path: python/mxnet/runtime.py
 ##
 @@ -69,12 +69,18 @@ def feature_list():
 features = [lib_features_c_array[i] for i in 
range(lib_features_size.value)]
 return features
 
+
 class Features(collections.OrderedDict):
 """
 OrderedDict of name to Feature
 """
+feature_dict = None
 
 Review comment:
   What is the concern here ? I don't see the harm of keeing it here. I will 
change it to singleton but caching results in individual files seems a 
makeshift approach. I would still prefer to keep it here for now till singleton 
is implemented 


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-08 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r311885126
 
 

 ##
 File path: src/c_api/c_api.cc
 ##
 @@ -537,20 +557,18 @@ int MXNDArrayGetShape(NDArrayHandle handle,
   API_END();
 }
 
-int MXNDArrayGetShapeEx(NDArrayHandle handle,
-int *out_dim,
-const int **out_pdata) {
-  MXAPIThreadLocalEntry *ret = MXAPIThreadLocalStore::Get();
-  API_BEGIN();
-  NDArray *arr = static_cast(handle);
+template
+inline void GetShape(NDArrayHandle handle, const dtype** out_pdata, int* 
out_dim,
 
 Review comment:
   For now GetShape makes sense since this function contains the logic to 
compute and return shape. So in my opinion keeping it GetShape would be better


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-08 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r311881512
 
 

 ##
 File path: include/mxnet/c_api.h
 ##
 @@ -1582,6 +1660,22 @@ MXNET_DLL int MXSymbolInferShape(SymbolHandle sym,
  const mx_uint ***aux_shape_data,
  int *complete);
 
+MXNET_DLL int MXSymbolInferShape64(SymbolHandle sym,
 
 Review comment:
   this is only a declaration. Its implementation is not yet there, I will add 
implementation with subsequent PRs 


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-08 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r311881512
 
 

 ##
 File path: include/mxnet/c_api.h
 ##
 @@ -1582,6 +1660,22 @@ MXNET_DLL int MXSymbolInferShape(SymbolHandle sym,
  const mx_uint ***aux_shape_data,
  int *complete);
 
+MXNET_DLL int MXSymbolInferShape64(SymbolHandle sym,
 
 Review comment:
   this is only a declaration. Its implementation is not yet there, I will add 
implementation with subsequent commits 


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-06 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r311353606
 
 

 ##
 File path: python/mxnet/ndarray/ndarray.py
 ##
 @@ -131,14 +133,24 @@ def _new_alloc_handle(shape, ctx, delay_alloc, 
dtype=mx_real_t):
 A new empty `NDArray` handle.
 """
 hdl = NDArrayHandle()
-check_call(_LIB.MXNDArrayCreateEx(
-c_array_buf(mx_uint, native_array('I', shape)),
-mx_uint(len(shape)),
-ctypes.c_int(ctx.device_typeid),
-ctypes.c_int(ctx.device_id),
-ctypes.c_int(int(delay_alloc)),
-ctypes.c_int(int(_DTYPE_NP_TO_MX[np.dtype(dtype).type])),
-ctypes.byref(hdl)))
+if Features().is_enabled('INT64_TENSOR_SIZE') and sys.version_info[0] > 2:
 
 Review comment:
   done


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-05 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r310804504
 
 

 ##
 File path: include/mxnet/tuple.h
 ##
 @@ -366,7 +366,6 @@ class Tuple {
   }
 };
 
-
 
 Review comment:
   done


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-05 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r310804533
 
 

 ##
 File path: src/c_api/c_api_common.h
 ##
 @@ -80,11 +81,15 @@ struct MXAPIThreadLocalEntry {
   /*! \brief result holder for returning shape pointer */
   std::vector arg_shape_data, out_shape_data, aux_shape_data;
   /*! \brief result holder for returning shape pointer */
-  std::vector arg_shape_data_ex, out_shape_data_ex, 
aux_shape_data_ex;
+  std::vector arg_shape_data_ex, out_shape_data_ex, 
aux_shape_data_ex;
+  //std::vector arg_shape_data_ex_int64, 
out_shape_data_ex_int64,
 
 Review comment:
   done


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-05 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r310787012
 
 

 ##
 File path: src/c_api/c_api_common.h
 ##
 @@ -80,11 +81,15 @@ struct MXAPIThreadLocalEntry {
   /*! \brief result holder for returning shape pointer */
   std::vector arg_shape_data, out_shape_data, aux_shape_data;
   /*! \brief result holder for returning shape pointer */
-  std::vector arg_shape_data_ex, out_shape_data_ex, 
aux_shape_data_ex;
+  std::vector arg_shape_data_ex, out_shape_data_ex, 
aux_shape_data_ex;
+  //std::vector arg_shape_data_ex_int64, 
out_shape_data_ex_int64,
+  //aux_shape_data_ex_int64;
   /*! \brief uint32_t buffer for returning shape pointer */
   std::vector arg_shape_buffer, out_shape_buffer, aux_shape_buffer;
   /*! \brief uint32_t buffer for returning shape pointer */
-  std::vector arg_shape_buffer_ex, out_shape_buffer_ex, 
aux_shape_buffer_ex;
+  std::vector arg_shape_buffer_ex, out_shape_buffer_ex, 
aux_shape_buffer_ex;
+  //std::vector arg_shape_buffer_ex_int64, out_shape_buffer_ex_int64,
+  // aux_shape_buffer_ex_int64;
   /*! \brief bool buffer */
   std::vector save_inputs, save_outputs;
 
 Review comment:
   done


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-05 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r310786940
 
 

 ##
 File path: src/c_api/c_api_symbolic.cc
 ##
 @@ -658,6 +658,85 @@ int MXSymbolInferShapeEx(SymbolHandle sym,
   API_END();
 }
 
+int MXSymbolInferShapeExInt64(SymbolHandle sym,
+  mx_uint num_args,
+  const char** keys,
+  const int64_t *arg_ind_ptr,
 
 Review comment:
   done


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-05 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r310784456
 
 

 ##
 File path: src/c_api/c_api.cc
 ##
 @@ -189,27 +189,46 @@ int MXNDArrayCreateNone(NDArrayHandle *out) {
   API_END();
 }
 
+template
+void CreateArray(const DataType* shape, dimtype ndim, int dev_type, int 
dev_id, int delay_alloc,
 
 Review comment:
   @apeforest Makes sense  how about `CreateNDArrayImpl` I think `MX` is 
always using with exposed c_api's. 


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-05 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r310784456
 
 

 ##
 File path: src/c_api/c_api.cc
 ##
 @@ -189,27 +189,46 @@ int MXNDArrayCreateNone(NDArrayHandle *out) {
   API_END();
 }
 
+template
+void CreateArray(const DataType* shape, dimtype ndim, int dev_type, int 
dev_id, int delay_alloc,
 
 Review comment:
   Makes sense  cool 


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-05 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r310718738
 
 

 ##
 File path: include/mxnet/c_api.h
 ##
 @@ -565,6 +567,13 @@ MXNET_DLL int MXNDArrayCreateEx(const mx_uint *shape,
   int dtype,
   NDArrayHandle *out);
 
+MXNET_DLL int MXNDArrayCreateExInt64(const mx_int64 *shape,
 
 Review comment:
   Any particular reason for that ?


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-03 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r310368544
 
 

 ##
 File path: python/mxnet/ndarray/ndarray.py
 ##
 @@ -131,14 +133,24 @@ def _new_alloc_handle(shape, ctx, delay_alloc, 
dtype=mx_real_t):
 A new empty `NDArray` handle.
 """
 hdl = NDArrayHandle()
-check_call(_LIB.MXNDArrayCreateEx(
-c_array_buf(mx_uint, native_array('I', shape)),
-mx_uint(len(shape)),
-ctypes.c_int(ctx.device_typeid),
-ctypes.c_int(ctx.device_id),
-ctypes.c_int(int(delay_alloc)),
-ctypes.c_int(int(_DTYPE_NP_TO_MX[np.dtype(dtype).type])),
-ctypes.byref(hdl)))
+if Features().is_enabled('INT64_TENSOR_SIZE') and sys.version_info[0] > 2:
 
 Review comment:
   Good Idea. I think it should be done in runtime.py itself. But can we do 
this in another PR ?


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-08-03 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r310368520
 
 

 ##
 File path: include/mxnet/c_api.h
 ##
 @@ -55,7 +55,9 @@ extern "C" {
 #endif
 
 /*! \brief manually define unsigned int */
-typedef unsigned int mx_uint;
+typedef uint32_t mx_uint;
+/*! \brief manually define 64-bit int */
+typedef int64_t mx_int64;
 
 Review comment:
   @larroy in language bindings we have created typedefs so that the signature 
of APIs on both sides(for e.g. C++ and python) are identical. Let me know if 
that answers your question 


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-07-29 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r308375768
 
 

 ##
 File path: include/mxnet/c_api.h
 ##
 @@ -802,6 +837,11 @@ MXNET_DLL int MXNDArrayReshape64(NDArrayHandle handle,
 MXNET_DLL int MXNDArrayGetShape(NDArrayHandle handle,
 mx_uint *out_dim,
 const mx_uint **out_pdata);
+
+MXNET_DLL int MXNDArrayGetShapeInt64(NDArrayHandle handle,
+ int *out_dim,
+ const mx_uint **out_pdata);
 
 Review comment:
   good catch thanks !


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-07-24 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r307003865
 
 

 ##
 File path: src/c_api/c_api.cc
 ##
 @@ -188,13 +188,29 @@ int MXNDArrayCreate(const mx_uint *shape,
   API_END();
 }
 
+int MXNDArrayCreateExInt64(const mx_int64 *shape,
+   mx_uint ndim,
+   int dev_type,
+   int dev_id,
+   int delay_alloc,
+   int dtype,
+   NDArrayHandle *out) {
+  API_BEGIN();
+  *out = new NDArray(
+  mxnet::TShape(shape, shape + ndim),
+  Context::Create(static_cast(dev_type), dev_id),
+  delay_alloc != 0,
+  dtype);
+  API_END();
+}
+
 int MXNDArrayCreateEx(const mx_uint *shape,
-mx_uint ndim,
-int dev_type,
-int dev_id,
-int delay_alloc,
-int dtype,
-NDArrayHandle *out) {
+  mx_uint ndim,
 
 Review comment:
   it breaks build itself 


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-07-23 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r306485549
 
 

 ##
 File path: src/c_api/c_api.cc
 ##
 @@ -188,13 +188,29 @@ int MXNDArrayCreate(const mx_uint *shape,
   API_END();
 }
 
+int MXNDArrayCreateExInt64(const mx_int64 *shape,
+   mx_uint ndim,
+   int dev_type,
+   int dev_id,
+   int delay_alloc,
+   int dtype,
+   NDArrayHandle *out) {
+  API_BEGIN();
+  *out = new NDArray(
+  mxnet::TShape(shape, shape + ndim),
+  Context::Create(static_cast(dev_type), dev_id),
+  delay_alloc != 0,
+  dtype);
+  API_END();
+}
+
 int MXNDArrayCreateEx(const mx_uint *shape,
-mx_uint ndim,
-int dev_type,
-int dev_id,
-int delay_alloc,
-int dtype,
-NDArrayHandle *out) {
+  mx_uint ndim,
 
 Review comment:
   keeping it consistent with previous implementation 


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-07-23 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r306485549
 
 

 ##
 File path: src/c_api/c_api.cc
 ##
 @@ -188,13 +188,29 @@ int MXNDArrayCreate(const mx_uint *shape,
   API_END();
 }
 
+int MXNDArrayCreateExInt64(const mx_int64 *shape,
+   mx_uint ndim,
+   int dev_type,
+   int dev_id,
+   int delay_alloc,
+   int dtype,
+   NDArrayHandle *out) {
+  API_BEGIN();
+  *out = new NDArray(
+  mxnet::TShape(shape, shape + ndim),
+  Context::Create(static_cast(dev_type), dev_id),
+  delay_alloc != 0,
+  dtype);
+  API_END();
+}
+
 int MXNDArrayCreateEx(const mx_uint *shape,
-mx_uint ndim,
-int dev_type,
-int dev_id,
-int delay_alloc,
-int dtype,
-NDArrayHandle *out) {
+  mx_uint ndim,
 
 Review comment:
   keping it consistent with previous implementation 


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-07-23 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r306478513
 
 

 ##
 File path: include/mxnet/c_api.h
 ##
 @@ -895,6 +940,10 @@ MXNET_DLL int MXNDArrayGetAuxType(NDArrayHandle handle,
   mx_uint i,
   int *out_type);
 
+MXNET_DLL int MXNDArrayGetAuxTypeInt64(NDArrayHandle handle,
+   mx_int64 i,
+   int *out_type);
 
 Review comment:
   not sure whether it should be int64 or not. out_type gets the type of aux 
data


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-07-22 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r306077093
 
 

 ##
 File path: src/operator/tensor/matrix_op-inl.h
 ##
 @@ -1323,12 +1323,12 @@ inline bool SliceLikeShape(const nnvm::NodeAttrs& 
attrs,
 inline void SliceLikeInferRanges(const mxnet::TShape& dshape,
  const mxnet::TShape& fshape,
  const mxnet::Tuple& axes,
- mxnet::Tuple>* 
param_begin,
- mxnet::Tuple>* param_end,
- mxnet::Tuple>* 
param_step) {
-  std::vector> pb(dshape.ndim());
-  std::vector> pe(dshape.ndim());
-  std::vector> ps(dshape.ndim());
+ mxnet::Tuple>* 
param_begin,
+ mxnet::Tuple>* 
param_end,
+ mxnet::Tuple>* 
param_step) {
+  std::vector> pb(dshape.ndim());
+  std::vector> pe(dshape.ndim());
+  std::vector> ps(dshape.ndim());
   if (axes.ndim() == 0) {
 for (int i = 0; i < dshape.ndim(); ++i) {
 
 Review comment:
   on a second thought ... its not required to use either on ndim since no. of 
dimensions are not supposed to be more than 2^31 at the moment. even our 
existing tensor data structure doesn't support that many dimensions. Will 
revert to int 


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-07-22 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r306077135
 
 

 ##
 File path: src/c_api/c_api.cc
 ##
 @@ -541,6 +557,34 @@ int MXNDArrayGetShapeEx(NDArrayHandle handle,
   API_END();
 }
 
+int MXNDArrayGetShapeExInt64(NDArrayHandle handle,
+int *out_dim,
 
 Review comment:
   ok


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-07-22 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r306076836
 
 

 ##
 File path: include/mxnet/c_api.h
 ##
 @@ -803,6 +843,11 @@ MXNET_DLL int MXNDArrayGetShape(NDArrayHandle handle,
 MXNET_DLL int MXNDArrayGetShapeEx(NDArrayHandle handle,
   int *out_dim,
   const int **out_pdata);
+
+MXNET_DLL int MXNDArrayGetShapeExInt64(NDArrayHandle handle,
+   int *out_dim,
+   const int64_t **out_pdata);
 
 Review comment:
   ok


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-07-22 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r306074443
 
 

 ##
 File path: src/operator/tensor/matrix_op-inl.h
 ##
 @@ -1323,12 +1323,12 @@ inline bool SliceLikeShape(const nnvm::NodeAttrs& 
attrs,
 inline void SliceLikeInferRanges(const mxnet::TShape& dshape,
  const mxnet::TShape& fshape,
  const mxnet::Tuple& axes,
- mxnet::Tuple>* 
param_begin,
- mxnet::Tuple>* param_end,
- mxnet::Tuple>* 
param_step) {
-  std::vector> pb(dshape.ndim());
-  std::vector> pe(dshape.ndim());
-  std::vector> ps(dshape.ndim());
+ mxnet::Tuple>* 
param_begin,
+ mxnet::Tuple>* 
param_end,
+ mxnet::Tuple>* 
param_step) {
+  std::vector> pb(dshape.ndim());
+  std::vector> pe(dshape.ndim());
+  std::vector> ps(dshape.ndim());
   if (axes.ndim() == 0) {
 for (int i = 0; i < dshape.ndim(); ++i) {
 
 Review comment:
   param_begin and param_end can be -1 hence we require signed integer


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


[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15593: Large Index Support for Slice

2019-07-22 Thread GitBox
access2rohit commented on a change in pull request #15593: Large Index Support 
for Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r306074443
 
 

 ##
 File path: src/operator/tensor/matrix_op-inl.h
 ##
 @@ -1323,12 +1323,12 @@ inline bool SliceLikeShape(const nnvm::NodeAttrs& 
attrs,
 inline void SliceLikeInferRanges(const mxnet::TShape& dshape,
  const mxnet::TShape& fshape,
  const mxnet::Tuple& axes,
- mxnet::Tuple>* 
param_begin,
- mxnet::Tuple>* param_end,
- mxnet::Tuple>* 
param_step) {
-  std::vector> pb(dshape.ndim());
-  std::vector> pe(dshape.ndim());
-  std::vector> ps(dshape.ndim());
+ mxnet::Tuple>* 
param_begin,
+ mxnet::Tuple>* 
param_end,
+ mxnet::Tuple>* 
param_step) {
+  std::vector> pb(dshape.ndim());
+  std::vector> pe(dshape.ndim());
+  std::vector> ps(dshape.ndim());
   if (axes.ndim() == 0) {
 for (int i = 0; i < dshape.ndim(); ++i) {
 
 Review comment:
   param_begin and param_end can be -1 hence we require signed integer


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