singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [singa] dcslin commented on a change in pull request #632: make astype return new tensor
Date Fri, 20 Mar 2020 13:09:04 GMT
dcslin commented on a change in pull request #632: make astype return new tensor
URL: https://github.com/apache/singa/pull/632#discussion_r395624001
 
 

 ##########
 File path: src/core/tensor/tensor.cc
 ##########
 @@ -152,29 +152,24 @@ Tensor Resize(const Tensor &in, const Shape &shape) {
     }                                                                          \
   } while (0)
 
-Tensor &Tensor::AsType(const DataType type) {
+// return new tensor
+Tensor Tensor::AsType(const DataType type) {
 
 Review comment:
   Yes. We could add a flag to indicate this explictly. But second thought is, by adding in-place
flag, `in-place=True` is also expected to be available. Then, it go back to the previous discussion,
if we want to do `in-place` for multi-referenced tensor, what is the expected behavior?

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


With regards,
Apache Git Services

Mime
View raw message