class_docstr: A subestimator to train and consider for ensembling.
  
  Args:
    estimator: A `tf.estimator.Estimator` or `tf.estimator.tpu.TPUEstimator`
      instance to consider for ensembling.
    train_input_fn: A function that provides input data for training as
      minibatches. It can be used to implement ensemble methods like bootstrap
      aggregating (a.k.a bagging) where each subnetwork trains on different
      slices of the training data. The function should construct and return one
      of the following:
       * A `tf.data.Dataset` object: Outputs of `Dataset` object must be a tuple
         `(features, labels)` with same constraints as below. NOTE: A Dataset
           must return *at least* two batches before hitting the end-of-input,
           otherwise all of training terminates.
         TODO: Figure out how to handle single-batch datasets.
       * A tuple `(features, labels)`: Where `features` is a `tf.Tensor` or a
         dictionary of string feature name to `Tensor` and `labels` is a
         `Tensor` or a dictionary of string label name to `Tensor`. Both
         `features` and `labels` are consumed by `estimator#model_fn`. They
         should satisfy the expectation of `estimator#model_fn` from inputs.
     prediction_only: If set to True, only runs the subestimator in prediction
       mode.
  
  Returns:
    An `AutoEnsembleSubestimator` instance to be auto-ensembled.
class_docstr_tok: ["A","subestimator","to","train","and","consider","for","ensembling",".","Args",":","estimator",":","A","`","tf.estimator.Estimator","`","or","`","tf.estimator.tpu.TPUEstimator","`","instance","to","consider","for","ensembling",".","train_input_fn",":","A","function","that","provides","input","data","for","training","as","minibatches",".","It","can","be","used","to","implement","ensemble","methods","like","bootstrap","aggregating","(","a.k.a","bagging",")","where","each","subnetwork","trains","on","different","slices","of","the","training","data",".","The","function","should","construct","and","return","one","of","the","following",":","*","A","`","tf.data.Dataset","`","object",":","Outputs","of","`","Dataset","`","object","must","be","a","tuple","`","(","features",",","labels",")","`","with","same","constraints","as","below",".","NOTE",":","A","Dataset","must","return","*","at","least","*","two","batches","before","hitting","the","end-of-input",",","otherwise","all","of","training","terminates",".","TODO",":","Figure","out","how","to","handle","single-batch","datasets",".","*","A","tuple","`","(","features",",","labels",")","`",":","Where","`","features","`","is","a","`","tf.Tensor","`","or","a","dictionary","of","string","feature","name","to","`","Tensor","`","and","`","labels","`","is","a","`","Tensor","`","or","a","dictionary","of","string","label","name","to","`","Tensor","`",".","Both","`","features","`","and","`","labels","`","are","consumed","by","`","estimator","#","model_fn","`",".","They","should","satisfy","the","expectation","of","`","estimator","#","model_fn","`","from","inputs",".","prediction_only",":","If","set","to","True",",","only","runs","the","subestimator","in","prediction","mode",".","Returns",":","An","`","AutoEnsembleSubestimator","`","instance","to","be","auto-ensembled","."]
code: def __new__(
      cls, estimator, train_input_fn=None, prediction_only=False
  ):
      return super(AutoEnsembleSubestimator, cls).__new__(
          cls, estimator, train_input_fn, prediction_only
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import inspect
  from adanet import subnetwork
  from adanet import tf_compat
  import tensorflow.compat.v2
label_desc: Use image node_id 1 for calling the AutoEnsembleSubestimator obj's underlying member method code with example usage: obj.__new__(cls, estimator, train_input_fn, prediction_only) and returns: super