docstr: Choose batch sizes based on GPU capability.
docstr_tok: ["Choose","batch","sizes","based","on","GPU","capability","."]
code: def _train_batch_sizes(self):
      """Choose batch sizes based on GPU capability."""
      for device in device_lib.list_local_devices():
          # TODO(b/141475121): We need some way to check which batch sizes would
          # work using a public API.
          if (
              tf.DeviceSpec.from_string(device.name).device_type
              == "GPU"
          ):
              # Avoid OOM errors with larger batch sizes, which seem to cause errors
              # later on even if caught.
              #
              # TODO(allenl): Base this on device memory; memory limit information
              # during the test seems to exclude the amount TensorFlow has allocated,
              # which isn't useful.
              if "K20" in device.physical_device_desc:
                  return (16,)
              # Quardro P1000.
              if "P1000" in device.physical_device_desc:
                  return (16,)
              if "P100" in device.physical_device_desc:
                  return (16, 32, 64)
  
          if (
              tf.DeviceSpec.from_string(device.name).device_type
              == "TPU"
          ):
              return (32,)
      return (16, 32)
  
imports: import gc
  import os
  import tempfile
  import time
  import tensorflow
  from tensorflow.python.client import device_lib
  from tensorflow.python.eager import context
  from tensorflow.python.eager import record
  from tensorflow.python.eager.benchmarks.resnet50 import resnet50
  from tensorflow.python.eager.benchmarks.resnet50 import resnet50_test_util
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 2 for calling the ResNet50Benchmarks obj's underlying member method code with example usage: obj._train_batch_sizes() and returns: int,  int, int, int, int, int,  int,  int