class_docstr: Benchmark class for Flax examples.
  
  This class overrides the behaviour of `self.assert*` methods to be
  deferred instead of failing immediately. This allows for using absltest
  assert methods for checking benchmark target metrics. This is also
  necessary for correctly reporting benchmark results and determining its
  success.
class_docstr_tok: ["Benchmark","class","for","Flax","examples",".","This","class","overrides","the","behaviour","of","`","self.assert","*","`","methods","to","be","deferred","instead","of","failing","immediately",".","This","allows","for","using","absltest","assert","methods","for","checking","benchmark","target","metrics",".","This","is","also","necessary","for","correctly","reporting","benchmark","results","and","determining","its","success","."]
docstr: Returns full name of test class and method calling report_benchmark.
  
  The name is based on the *outermost* Benchmark class in the class stack.
  Based on tensorflow/python/platform/benchmark.py
  
  Args:
    prefix: str. Prefix that the caller method must have.
  
  Returns:
    Resolved test name as `ClassName.test_name`.
docstr_tok: ["Returns","full","name","of","test","class","and","method","calling","report_benchmark",".","The","name","is","based","on","the","*","outermost","*","Benchmark","class","in","the","class","stack",".","Based","on","tensorflow\/python\/platform\/benchmark.py","Args",":","prefix",":","str",".","Prefix","that","the","caller","method","must","have",".","Returns",":","Resolved","test","name","as","`","ClassName.test_name","`","."]
code: def _get_test_name(self, prefix="test_"):
      """Returns full name of test class and method calling report_benchmark.
  
      The name is based on the *outermost* Benchmark class in the class stack.
      Based on tensorflow/python/platform/benchmark.py
  
      Args:
        prefix: str. Prefix that the caller method must have.
  
      Returns:
        Resolved test name as `ClassName.test_name`.
      """
      # Find the caller method (outermost Benchmark class).
      stack = inspect.stack()
      calling_class, name = None, None
      for frame_info in stack[::-1]:
          f_locals = frame_info.frame.f_locals
          f_self = f_locals.get("self", None)
          if isinstance(f_self, Benchmark):
              name = frame_info.function
              if name.startswith(prefix):
                  calling_class = f_self
                  break
      if calling_class is None:
          raise ValueError(
              "Unable to determine the calling Benchmark class."
          )
  
      # Prefix the name with the class name.
      class_name = type(calling_class).__name__
      name = "{}.{}".format(class_name, name)
      return name
  
imports: import functools
  import inspect
  import itertools
  import json
  import os
  import tempfile
  from typing import Dict
  from absl import flags, logging
  from absl.testing import absltest
  from tensorboard.backend.event_processing import directory_watcher, event_file_loader, io_wrapper
  from tensorboard.summary import v1
  from tensorboard.util import tensor_util
  from flax import io
label_desc: Use image node_id 13 for calling the Benchmark obj's underlying member method code with example usage: obj._get_test_name(prefix) and returns: name