shitou112 opened a new issue #9455: An error occurred while calculating the 
square of ndarray by using gpu context
URL: https://github.com/apache/incubator-mxnet/issues/9455
 
 
   #### 1. When I use a**2 to compute square, I encounter an error. 
   ```
   Input: a = nd.array([-1], mx.gpu())
          a ** 2
   
   Output: [ nan]
           <NDArray 1 @gpu(0)>
   ```
   #### 2. However, when using ctx=mx.cpu(), the result is right.
   ```
   Input: a = nd.array([-1], mx.cpu())
          a ** 2
   
   Output: [ 1.]
           <NDArray 1 @cpu(0)>
   ```
   
   #### 3. when I use a*a to compute square, the result is also right.
   ```
   Input: a = nd.array([-1], mx.gpu())
          a * a
   
   Output: [ 1.]
           <NDArray 1 @gpu(0)>
   ```
   

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


With regards,
Apache Git Services

Reply via email to