You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/02/07 22:22:29 UTC

[GitHub] sandeep-krishnamurthy commented on a change in pull request #14083: Remove inplace support for ToTensor operator

sandeep-krishnamurthy commented on a change in pull request #14083: Remove inplace support for ToTensor operator
URL: https://github.com/apache/incubator-mxnet/pull/14083#discussion_r254888170
 
 

 ##########
 File path: src/operator/image/image_random-inl.h
 ##########
 @@ -79,16 +79,15 @@ inline bool ToTensorType(const nnvm::NodeAttrs& attrs,
 
 // Operator Implementation
 
-template<int req>
 struct totensor_forward {
   template<typename DType>
   MSHADOW_XINLINE static void Map(uint32_t c, float* out_data, const DType* in_data,
                                   const int length, const int channel, const int step,
                                   const float normalize_factor = 255.0f) {
       #pragma omp parallel for
       for (int i = 0; i < length; ++i) {
-        KERNEL_ASSIGN(out_data[step + c*length + i], req,
-                      (in_data[step + i*channel + c]) / normalize_factor);
+        out_data[step + c*length + i] =
 
 Review comment:
   Ah. You are right. Thanks. I removed the support for in place during operator registration. 
   Pasting below your notes for any future reference regarding this PR. Thanks.
   
   ```
   think about the case from HWC to NCHW
   values get overwrite and can never be recovered
   to support inplace, you have to have a temp buffer
    .set_attr<nnvm::FInplaceOption>("FInplaceOption",
     [](const NodeAttrs& attrs) {
       return std::vector<std::pair<int, int> >{{0, 0}};
     }) 
   disable it
   if you don’t want to implement inplace op
   ```

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


With regards,
Apache Git Services