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/03/02 23:33:46 UTC

[GitHub] stephenrawls commented on issue #14264: nd.reshape truncate values

stephenrawls commented on issue #14264: nd.reshape truncate values
URL: https://github.com/apache/incubator-mxnet/issues/14264#issuecomment-468970765
 
 
   @NonvolatileMemory Do you mean you think it's a bug because users should expect mx.nd.Reshape() to have identical behavior to NumPy's Reshape() operator?
   
   If so, as mentioned, I don't have an opinion at all, and as mentioned I am happy for this feature to be turned on optionally, or to be renamed to something else entirely, e.g. mx.nd.SomeNewOperator().
   
   If you mean it's a bug for users to want this feature then I disagree. For example, consider the world of NLP where you have dynamically shaped inputs. Maybe one of my inputs is only 5 words long, and another is 10 words long. I might have a routine I want to run at inference time that needs to use an NDArray with one of its dimensions sized to fit however many words are in my utterance. I would like to (1) not have to do dynamic memory allocations during inference; and (2) to not have to allocate extra space for each shape I want to support. To do this you can image it is convenient to be able to do this:
   
   ```
   def init():
     some_array = mx.nd.array( max_shape )
   
   def infer():
     ...
     some_array_local = some_array.Reshape( current_shape )
     ...
   ```
   
   Just to reiterate, it doesn't matter to me that Reshape() retains this behavior, just that MxNet has some way of spelling this 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