class_docstr: Phoenix: A smart search AutoML algorithm.
class_docstr_tok: ["Phoenix",":","A","smart","search","AutoML","algorithm","."]
docstr: Returns a Phoenix `Estimator` for train and evaluation.
  
  Args:
    run_config: `RunConfig` object to configure the runtime settings.
    hparams: `HParams` instance defining custom hyperparameters.
    train_steps: The total number of training steps.
    train_batch_size: batch size for train.
    eval_on_tpu: whether to use tpu for evaluation.
    embedding_config_spec: (Optional) Embedding config spec instance.
    eval_batch_size: (Optional) if not set, we use train batch size.
  
  Returns:
    Returns an `TPUEstimator`.
  
  Raises:
    ValueError: in case flatten is used as a search block or is missing from
    the initial architecture.
docstr_tok: ["Returns","a","Phoenix","`","Estimator","`","for","train","and","evaluation",".","Args",":","run_config",":","`","RunConfig","`","object","to","configure","the","runtime","settings",".","hparams",":","`","HParams","`","instance","defining","custom","hyperparameters",".","train_steps",":","The","total","number","of","training","steps",".","train_batch_size",":","batch","size","for","train",".","eval_on_tpu",":","whether","to","use","tpu","for","evaluation",".","embedding_config_spec",":","(","Optional",")","Embedding","config","spec","instance",".","eval_batch_size",":","(","Optional",")","if","not","set",",","we","use","train","batch","size",".","Returns",":","Returns","an","`","TPUEstimator","`",".","Raises",":","ValueError",":","in","case","flatten","is","used","as","a","search","block","or","is","missing","from","the","initial","architecture","."]
code: def get_tpu_estimator(
      self,
      run_config,
      hparams,
      train_steps,
      train_batch_size,
      eval_on_tpu,
      embedding_config_spec=None,
      eval_batch_size=None,
  ):
      """Returns a Phoenix `Estimator` for train and evaluation.
  
      Args:
        run_config: `RunConfig` object to configure the runtime settings.
        hparams: `HParams` instance defining custom hyperparameters.
        train_steps: The total number of training steps.
        train_batch_size: batch size for train.
        eval_on_tpu: whether to use tpu for evaluation.
        embedding_config_spec: (Optional) Embedding config spec instance.
        eval_batch_size: (Optional) if not set, we use train batch size.
  
      Returns:
        Returns an `TPUEstimator`.
  
      Raises:
        ValueError: in case flatten is used as a search block or is missing from
        the initial architecture.
      """
  
      if not all(
          "FLATTEN" not in block for block in hparams.new_block_type
      ):
          raise ValueError("Flatten cannot be a search block type")
  
      return tf.compat.v1.estimator.tpu.TPUEstimator(
          model_fn=self._make_model_fn(
              run_config=run_config,
              train_steps=train_steps,
              use_tpu=True,
          ),
          config=run_config,
          use_tpu=True,
          params=hparams,
          train_batch_size=train_batch_size,
          eval_batch_size=(eval_batch_size or train_batch_size),
          embedding_config_spec=embedding_config_spec,
          eval_on_tpu=eval_on_tpu,
      )
  
imports: import functools
  import inspect
  from absl import logging
  import keras_tuner
  from model_search import controller
  from model_search import hparam
  from model_search import loss_fns
  from model_search import metric_fns
  from model_search import task_manager
  from model_search.architecture import architecture_utils
  from model_search.generators import base_tower_generator
  from model_search.generators import trial_utils
  from model_search.meta import transfer_learning
  from model_search.metadata import ml_metadata_db
  from model_search.proto import phoenix_spec_pb2
  from model_search.proto import transfer_learning_spec_pb2
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 8 for calling the Phoenix obj's underlying member method code with example usage: obj.get_tpu_estimator(run_config, hparams, train_steps, train_batch_size, eval_on_tpu, embedding_config_spec, eval_batch_size) and returns: tf