class_docstr: Executor is the object providing efficient symbolic and imperative graph
  execution and optimization.
  
  Examples
  --------
  >>> # typical approach to create an executor is to bind symbol
  >>> a = mx.sym.var('a')
  >>> b = mx.sym.var('b')
  >>> c = 2 * a + b
  >>> texec = c._bind(mx.cpu(), {'a': mx.nd.array([1,2]), 'b':mx.nd.array([2,3])})
class_docstr_tok: ["Executor","is","the","object","providing","efficient","symbolic","and","imperative","graph","execution","and","optimization",".","Examples","--","--","--","--",">",">",">","#","typical","approach","to","create","an","executor","is","to","bind","symbol",">",">",">","a","=","mx.sym.var","(","'","a","'",")",">",">",">","b","=","mx.sym.var","(","'","b","'",")",">",">",">","c","=","2","*","a","+","b",">",">",">","texec","=","c._bind","(","mx.cpu","(",")",",","{","'","a","'",":","mx.nd.array","(","[","1,2","]",")",",","'","b","'",":","mx.nd.array","(","[","2,3","]",")","}",")"]
docstr: Calculate the outputs specified by the bound symbol.
  
  Parameters
  ----------
  is_train: bool, optional
      Whether this forward is for evaluation purpose. If True,
      a backward call is expected to follow.
  
  **kwargs
      Additional specification of input arguments.
  
  Examples
  --------
  >>> # doing forward by specifying data
  >>> texec.forward(is_train=True, data=mydata)
  >>> # doing forward by not specifying things, but copy to the executor before hand
  >>> mydata.copyto(texec.arg_dict['data'])
  >>> texec.forward(is_train=True)
  >>> # doing forward by specifying data and get outputs
  >>> outputs = texec.forward(is_train=True, data=mydata)
  >>> print(outputs[0].asnumpy())
docstr_tok: ["Calculate","the","outputs","specified","by","the","bound","symbol",".","Parameters","--","--","--","--","--","is_train",":","bool",",","optional","Whether","this","forward","is","for","evaluation","purpose",".","If","True",",","a","backward","call","is","expected","to","follow",".","*","*","kwargs","Additional","specification","of","input","arguments",".","Examples","--","--","--","--",">",">",">","#","doing","forward","by","specifying","data",">",">",">","texec.forward","(","is_train=True",",","data=mydata",")",">",">",">","#","doing","forward","by","not","specifying","things",",","but","copy","to","the","executor","before","hand",">",">",">","mydata.copyto","(","texec.arg_dict","[","'data","'","]",")",">",">",">","texec.forward","(","is_train=True",")",">",">",">","#","doing","forward","by","specifying","data","and","get","outputs",">",">",">","outputs","=","texec.forward","(","is_train=True",",","data=mydata",")",">",">",">","print","(","outputs","[","0","]",".asnumpy","(",")",")"]
code: def forward(self, is_train=False, **kwargs):
      """Calculate the outputs specified by the bound symbol.
  
      Parameters
      ----------
      is_train: bool, optional
          Whether this forward is for evaluation purpose. If True,
          a backward call is expected to follow.
  
      **kwargs
          Additional specification of input arguments.
  
      Examples
      --------
      >>> # doing forward by specifying data
      >>> texec.forward(is_train=True, data=mydata)
      >>> # doing forward by not specifying things, but copy to the executor before hand
      >>> mydata.copyto(texec.arg_dict['data'])
      >>> texec.forward(is_train=True)
      >>> # doing forward by specifying data and get outputs
      >>> outputs = texec.forward(is_train=True, data=mydata)
      >>> print(outputs[0].asnumpy())
      """
      if kwargs:
          for name, array in kwargs.items():
              if name in self._input_names:
                  index = self._input_names.index(name)
                  with self._device:
                      arr = ndarray.array(array, dtype=array.dtype)
                      if self._args[index] is None:
                          self._args[index] = arr
                          # get req
                          if isinstance(self._grad_req, str):
                              req = self._grad_req
                          else:
                              assert isinstance(self._grad_req, dict)
                              req = self._grad_req[name]
                          if req != "null":
                              with self._device:
                                  self._args[index].attach_grad(req)
                      else:
                          self._args[index][:] = arr
  
      from . import autograd
  
      default_device = None if self._input_names else self._device
      with autograd.record(train_mode=is_train):
          self.outputs = self._cached_op(
              *self._args, default_device=default_device
          )
      if not isinstance(self.outputs, (list, tuple)):
          self.outputs = [self.outputs]
      return self.outputs
  
file_path: mxnet/python/mxnet/executor.py
imports: import numpy
  from .None import ndarray
label_desc: Use image node_id 3 for calling the Executor obj's underlying member method code with example usage: obj.forward(is_train) and returns: self