crqcrq001 opened a new issue #10502: MXPredReshape
URL: https://github.com/apache/incubator-mxnet/issues/10502
 
 
   When I Use MXPredCreate create a GPU handle, then use MXPredReshape to 
reshape the input shape,
   it failure. 
   This may cause by default context is cpu .
   in MXPredReshape ()
   .....
   // bind line 324
     {
       std::map<std::string, Context> ctx_map;
       std::vector<NDArray> grad_store;
       grad_store.reserve(ret->arg_arrays.size());
       std::vector<OpReqType> grad_req(ret->arg_arrays.size(), kNullOp);
   
       ret->exec.reset(Executor::Bind(ret->sym, ret->ctx, ctx_map,
                                      ret->arg_arrays,
                                      grad_store, grad_req,
                                      ret->aux_arrays,
                                      p->exec.get()));
          // here I think it reset the executor by ret->ctx (but in 
MXPredCreate ret->ctx is not assignment)
       ret->out_shapes = out_shapes;
       ret->out_arrays = ret->exec->outputs();
     }  
   So I change MXPredCreatePartialOut()
   ....
    // bind line 234
     {
       std::map<std::string, Context> ctx_map;
       std::vector<NDArray> grad_store(arg_arrays.size());
       std::vector<OpReqType> grad_req(arg_arrays.size(), kNullOp);
   
   
       ret->exec.reset(Executor::Bind(sym, ctx, ctx_map,
                                      arg_arrays,
                                      grad_store, grad_req,
                                      aux_arrays));
       ret->ctx=ctx;//here
       ret->out_shapes = out_shapes;
       ret->out_arrays = ret->exec->outputs();
     }
   
   Is this correct?
    

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