parameters: (self, predicate, first_n=0, device_name=None)
return_statement: return matched_data
docstring: Find dumped tensor data by a certain predicate.
  
      Args:
        predicate: A callable that takes two input arguments:
  
          ```python
          def predicate(debug_tensor_datum, tensor):
            # returns a bool
          ```
  
          where `debug_tensor_datum` is an instance of `DebugTensorDatum`, which
          carries the metadata, such as the `Tensor`'s node name, output slot
          timestamp, debug op name, etc.; and `tensor` is the dumped tensor value
          as a `numpy.ndarray`.
        first_n: (`int`) return only the first n `DebugTensotDatum` instances (in
          time order) for which the predicate returns True. To return all the
          `DebugTensotDatum` instances, let first_n be <= 0.
        device_name: optional device name.
  
      Returns:
        A list of all `DebugTensorDatum` objects in this `DebugDumpDir` object
         for which predicate returns True, sorted in ascending order of the
         timestamp.
docstring_summary: Find dumped tensor data by a certain predicate.
docstring_tokens: Find dumped tensor data by a certain predicate .
function: def find(self, predicate, first_n=0, device_name=None):
      """Find dumped tensor data by a certain predicate.
  
      Args:
        predicate: A callable that takes two input arguments:
  
          ```python
          def predicate(debug_tensor_datum, tensor):
            # returns a bool
          ```
  
          where `debug_tensor_datum` is an instance of `DebugTensorDatum`, which
          carries the metadata, such as the `Tensor`'s node name, output slot
          timestamp, debug op name, etc.; and `tensor` is the dumped tensor value
          as a `numpy.ndarray`.
        first_n: (`int`) return only the first n `DebugTensotDatum` instances (in
          time order) for which the predicate returns True. To return all the
          `DebugTensotDatum` instances, let first_n be <= 0.
        device_name: optional device name.
  
      Returns:
        A list of all `DebugTensorDatum` objects in this `DebugDumpDir` object
         for which predicate returns True, sorted in ascending order of the
         timestamp.
      """
  
      matched_data = []
      for device in (self._dump_tensor_data if device_name is None
                     else (self._dump_tensor_data[device_name],)):
        for datum in self._dump_tensor_data[device]:
          if predicate(datum, datum.get_tensor()):
            matched_data.append(datum)
  
            if first_n > 0 and len(matched_data) >= first_n:
              return matched_data
  
      return matched_data
function_tokens: def find ( self , predicate , first_n = 0 , device_name = None ) : matched_data = [ ] for device in ( self . _dump_tensor_data if device_name is None else ( self . _dump_tensor_data [ device_name ] , ) ) : for datum in self . _dump_tensor_data [ device ] : if predicate ( datum , datum . get_tensor ( ) ) : matched_data . append ( datum ) if first_n > 0 and len ( matched_data ) >= first_n : return matched_data return matched_data