class_docstr: Class for BERT few-shot evaluation.
class_docstr_tok: ["Class","for","BERT","few-shot","evaluation","."]
docstr: Lazy-loads given dataset.
docstr_tok: ["Lazy-loads","given","dataset","."]
code: def _get_dataset(self, config):
      """Lazy-loads given dataset."""
      if (
          config.dataset_configs.task
          not in self.SUPPORTED_FEWSHOT_TASK_NAMES
      ):
          raise ValueError(
              "dataset_configs.task_name must be one of [{}].".format(
                  ", ".join(self.SUPPORTED_FEWSHOT_TASK_NAMES)
              )
          )
      key = config.dataset_configs.task
      try:
          return self._datasets[key]
      except KeyError:
          data_rng = jax.random.PRNGKey(self.rng_seed)
          dataset = train_utils.get_dataset(config, data_rng)
          train_ds = dataset.train_iter
          num_train_samples = dataset.meta_data["num_train_examples"]
          test_ds = dataset.valid_iter
          num_test_samples = dataset.meta_data["num_eval_examples"]
          num_classes = dataset.meta_data["num_classes"]
          return self._datasets.setdefault(
              key,
              (
                  train_ds,
                  test_ds,
                  num_train_samples,
                  num_test_samples,
                  num_classes,
              ),
          )
  
imports: import functools
  from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
  from absl import logging
  from clu import metric_writers
  import flax
  from flax import jax_utils
  import flax.linen
  import jax
  import jax.numpy
  import jax.profiler
  import ml_collections
  import numpy
  from scenic.common_lib import debug_utils
  from scenic.train_lib import optimizers
  from scenic.train_lib import train_utils
  import scipy
  import sklearn.metrics
label_desc: Use image node_id 2 for calling the BERTFewShotEvaluator obj's underlying member method code with example usage: obj._get_dataset(config) and returns: self, self