parameters: (self, args, screen_info=None)
return_statement: return debugger_cli_common.RichTextLines(lines)
docstring: Inject value to a given tensor.
  
      Args:
        args: (list of str) command-line arguments for the "step" command.
        screen_info: Information about screen.
  
      Returns:
        (RichTextLines) Screen output for the result of the stepping action.
docstring_summary: Inject value to a given tensor.
docstring_tokens: Inject value to a given tensor .
function: def inject_value(self, args, screen_info=None):
      """Inject value to a given tensor.
  
      Args:
        args: (list of str) command-line arguments for the "step" command.
        screen_info: Information about screen.
  
      Returns:
        (RichTextLines) Screen output for the result of the stepping action.
      """
  
      _ = screen_info  # Currently unused.
  
      if screen_info and "cols" in screen_info:
        np_printoptions = {"linewidth": screen_info["cols"]}
      else:
        np_printoptions = {}
  
      parsed = self.arg_parsers["inject_value"].parse_args(args)
  
      tensor_names = self._resolve_tensor_names(parsed.tensor_name)
      if not tensor_names:
        return cli_shared.error(
            self._MESSAGE_TEMPLATES["NOT_IN_CLOSURE"] % parsed.tensor_name)
      elif len(tensor_names) > 1:
        return cli_shared.error(
            self._MESSAGE_TEMPLATES["MULTIPLE_TENSORS"] % parsed.tensor_name)
      else:
        tensor_name = tensor_names[0]
  
      tensor_value = eval(parsed.tensor_value_str)  # pylint: disable=eval-used
  
      try:
        self._node_stepper.override_tensor(tensor_name, tensor_value)
        lines = [
            "Injected value \"%s\"" % parsed.tensor_value_str,
            "  to tensor \"%s\":" % tensor_name, ""
        ]
  
        tensor_lines = tensor_format.format_tensor(
            tensor_value,
            tensor_name,
            include_metadata=True,
            np_printoptions=np_printoptions).lines
        lines.extend(tensor_lines)
  
      except ValueError:
        lines = [
            "ERROR: Failed to inject value to tensor %s" % parsed.tensor_name
        ]
  
      return debugger_cli_common.RichTextLines(lines)
function_tokens: def inject_value ( self , args , screen_info = None ) : _ = screen_info # Currently unused. if screen_info and "cols" in screen_info : np_printoptions = { "linewidth" : screen_info [ "cols" ] } else : np_printoptions = { } parsed = self . arg_parsers [ "inject_value" ] . parse_args ( args ) tensor_names = self . _resolve_tensor_names ( parsed . tensor_name ) if not tensor_names : return cli_shared . error ( self . _MESSAGE_TEMPLATES [ "NOT_IN_CLOSURE" ] % parsed . tensor_name ) elif len ( tensor_names ) > 1 : return cli_shared . error ( self . _MESSAGE_TEMPLATES [ "MULTIPLE_TENSORS" ] % parsed . tensor_name ) else : tensor_name = tensor_names [ 0 ] tensor_value = eval ( parsed . tensor_value_str ) # pylint: disable=eval-used try : self . _node_stepper . override_tensor ( tensor_name , tensor_value ) lines = [ "Injected value \"%s\"" % parsed . tensor_value_str , "  to tensor \"%s\":" % tensor_name , "" ] tensor_lines = tensor_format . format_tensor ( tensor_value , tensor_name , include_metadata = True , np_printoptions = np_printoptions ) . lines lines . extend ( tensor_lines ) except ValueError : lines = [ "ERROR: Failed to inject value to tensor %s" % parsed . tensor_name ] return debugger_cli_common . RichTextLines ( lines )