code: def _get_device_type(self):
      for accelerator in ["GPU", "TPU"]:
          if config.list_physical_devices(accelerator):
              return accelerator
      return "CPU"
  
imports: import functools
  from absl.testing import parameterized
  from xla.service import hlo_pb2
  from tensorflow.python.distribute.cluster_resolver import tpu_cluster_resolver
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import config
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import custom_gradient
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import googletest
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the RecomputeGradMemoryTest obj's underlying member method code with example usage: obj._get_device_type() and returns: str, accelerator