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 2021/02/05 05:04:52 UTC

[GitHub] [incubator-mxnet] Zha0q1 commented on a change in pull request #19844: [BUGFIX] Fix linspace

Zha0q1 commented on a change in pull request #19844:
URL: https://github.com/apache/incubator-mxnet/pull/19844#discussion_r570722696



##########
File path: src/operator/tensor/init_op.h
##########
@@ -731,14 +731,23 @@ inline bool RangeShape(const nnvm::NodeAttrs& attrs,
   return true;
 }
 
+template<typename DType>
 struct linspace_fwd {
-  template<typename DType>
   MSHADOW_XINLINE static void Map(index_t i, double start, double stop, double step,
                                   int req, DType* out) {
     KERNEL_ASSIGN(out[i], req, static_cast<DType>(start + step * i));
   }
 };
 
+// Round towards -infinity for int type

Review comment:
       I think here we can use a macro to generate templated structs for int32 int64 int16 and int8




----------------------------------------------------------------
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:
users@infra.apache.org