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/08 23:25:48 UTC

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

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



##########
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:
       introduced `std::is_integral` for all int types. Thanks for the suggestion!




----------------------------------------------------------------
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