(features)
Set the global random offset from the random offset feature.
Set the global random offset from the random offset feature.
Set the global random offset from the random offset feature .
def set_random_offset_from_features(features):
  """Set the global random offset from the random offset feature."""
  # Take the first index in case the TPU core got multiple examples.
  global _RANDOM_OFFSET_TENSOR
  _RANDOM_OFFSET_TENSOR = features.pop(_RANDOM_OFFSET_FEATURE_KEY)[0]
  logging.info("Got global random offset: %s", _RANDOM_OFFSET_TENSOR)
def set_random_offset_from_features ( features ) : # Take the first index in case the TPU core got multiple examples. global _RANDOM_OFFSET_TENSOR _RANDOM_OFFSET_TENSOR = features . pop ( _RANDOM_OFFSET_FEATURE_KEY ) [ 0 ] logging . info ( "Got global random offset: %s" , _RANDOM_OFFSET_TENSOR )