parameters: (self, tensor)
return_statement: return self._indirect_captures[ops.tensor_id(tensor)]
docstring: Returns the captured resource tensor.
  
      Resource-type tensors are not accumulated. If a resource tensor exists in
      the loop body it must either be a loop input or an output of a nested While
      op inside the loop body which had captured the external resource.
  
      Args:
        tensor: the external resource Tensor to be captured.
  
      Returns:
        Tensor in this graph.
docstring_summary: Returns the captured resource tensor.
docstring_tokens: Returns the captured resource tensor .
function: def _resource_capture_helper(self, tensor):
      """Returns the captured resource tensor.
  
      Resource-type tensors are not accumulated. If a resource tensor exists in
      the loop body it must either be a loop input or an output of a nested While
      op inside the loop body which had captured the external resource.
  
      Args:
        tensor: the external resource Tensor to be captured.
  
      Returns:
        Tensor in this graph.
      """
      assert tensor.dtype == dtypes.resource
  
      index = util.resource_input_index(
          tensor.name, [t.name for t in self._forward_graph.inputs],
          {op.name: op.node_def for op in self._forward_graph.get_operations()},
          self._forward_graph._functions)
  
      input_placeholder = self._forward_graph.inputs[index]
      tensor_in_outer_graph = self._forward_graph._while.inputs[index]
  
      assert input_placeholder.dtype == dtypes.resource
      assert tensor_in_outer_graph.dtype == dtypes.resource
      # This must be a loop invariant.
      assert input_placeholder is self._forward_graph.outputs[index], (
          "Resource tensors must be loop invariants %s." % tensor_in_outer_graph)
  
      self._indirect_captures[ops.tensor_id(tensor)] = self.capture(
          tensor_in_outer_graph, whitelisted=True)
      return self._indirect_captures[ops.tensor_id(tensor)]
function_tokens: def _resource_capture_helper ( self , tensor ) : assert tensor . dtype == dtypes . resource index = util . resource_input_index ( tensor . name , [ t . name for t in self . _forward_graph . inputs ] , { op . name : op . node_def for op in self . _forward_graph . get_operations ( ) } , self . _forward_graph . _functions ) input_placeholder = self . _forward_graph . inputs [ index ] tensor_in_outer_graph = self . _forward_graph . _while . inputs [ index ] assert input_placeholder . dtype == dtypes . resource assert tensor_in_outer_graph . dtype == dtypes . resource # This must be a loop invariant. assert input_placeholder is self . _forward_graph . outputs [ index ] , ( "Resource tensors must be loop invariants %s." % tensor_in_outer_graph ) self . _indirect_captures [ ops . tensor_id ( tensor ) ] = self . capture ( tensor_in_outer_graph , whitelisted = True ) return self . _indirect_captures [ ops . tensor_id ( tensor ) ]