parameters: (self, *inputs)
return_statement: return tuple(parallel_inputs_run)
docstring: Slice inputs tensors by parallel strategies.
  
          Args:
              inputs (Function or Cell): inputs of construct method.
docstring_summary: Slice inputs tensors by parallel strategies.
docstring_tokens: Slice inputs tensors by parallel strategies .
function: def _load_inputs(self, *inputs):
          """
          Slice inputs tensors by parallel strategies.
  
          Args:
              inputs (Function or Cell): inputs of construct method.
          """
          parallel_inputs_run = []
          # judge if *args exists in input
          if self.argspec[1] is not None:
              prefix = self.argspec[1]
              for i in range(len(inputs)):
                  key = prefix + str(i)
                  self._construct_inputs_names = self._construct_inputs_names + (key,)
                  self._construct_inputs_num = self._construct_inputs_num + 1
          for i, tensor in enumerate(inputs):
              key = self._construct_inputs_names[i]
              # if input is not used, self.parameter_layout_dict may not contain the key
              if key not in self.parameter_layout_dict:
                  logger.warning("Layout dict does not contain the key %s.", key)
                  parallel_inputs_run.append(tensor)
              else:
                  layout = self.parameter_layout_dict[key]
                  new_tensor = _load_tensor_by_layout(tensor, layout)
                  parallel_inputs_run.append(new_tensor)
          return tuple(parallel_inputs_run)
function_tokens: def _load_inputs ( self , * inputs ) : parallel_inputs_run = [ ] # judge if *args exists in input if self . argspec [ 1 ] is not None : prefix = self . argspec [ 1 ] for i in range ( len ( inputs ) ) : key = prefix + str ( i ) self . _construct_inputs_names = self . _construct_inputs_names + ( key , ) self . _construct_inputs_num = self . _construct_inputs_num + 1 for i , tensor in enumerate ( inputs ) : key = self . _construct_inputs_names [ i ] # if input is not used, self.parameter_layout_dict may not contain the key if key not in self . parameter_layout_dict : logger . warning ( "Layout dict does not contain the key %s." , key ) parallel_inputs_run . append ( tensor ) else : layout = self . parameter_layout_dict [ key ] new_tensor = _load_tensor_by_layout ( tensor , layout ) parallel_inputs_run . append ( new_tensor ) return tuple ( parallel_inputs_run )