class_docstr: An abstract class for data processing pipelines that transform datasets.
  
  A Pipeline can transform one or many inputs to one or many outputs. When there
  are many inputs or outputs, each input/output is assigned a string name.
  
  The `transform` method converts a given input or dictionary of inputs to
  a list of transformed outputs, or a dictionary mapping names to lists of
  transformed outputs for each name.
  
  The `get_stats` method returns any Statistics that were collected during the
  last call to `transform`. These Statistics can give feedback about why any
  data was discarded and what the input data is like.
  
  `Pipeline` implementers should call `_set_stats` from within `transform` to
  set the Statistics that will be returned by the next call to `get_stats`.
class_docstr_tok: ["An","abstract","class","for","data","processing","pipelines","that","transform","datasets",".","A","Pipeline","can","transform","one","or","many","inputs","to","one","or","many","outputs",".","When","there","are","many","inputs","or","outputs",",","each","input\/output","is","assigned","a","string","name",".","The","`","transform","`","method","converts","a","given","input","or","dictionary","of","inputs","to","a","list","of","transformed","outputs",",","or","a","dictionary","mapping","names","to","lists","of","transformed","outputs","for","each","name",".","The","`","get_stats","`","method","returns","any","Statistics","that","were","collected","during","the","last","call","to","`","transform","`",".","These","Statistics","can","give","feedback","about","why","any","data","was","discarded","and","what","the","input","data","is","like",".","`","Pipeline","`","implementers","should","call","`","_set_stats","`","from","within","`","transform","`","to","set","the","Statistics","that","will","be","returned","by","the","next","call","to","`","get_stats","`","."]
docstr: Constructs a `Pipeline` object.
  
  Subclass constructors are expected to call this constructor.
  
  A type signature is a Python class or primative collection containing
  classes. Valid type signatures for `Pipeline` inputs and outputs are either
  a Python class, or a dictionary mapping string names to classes. An object
  matches a type signature if its type equals the type signature
  (i.e. type('hello') == str) or, if its a collection, the types in the
  collection match (i.e. {'hello': 'world', 'number': 1234} matches type
  signature {'hello': str, 'number': int})
  
  `Pipeline` instances have (preferably unique) string names. These names act
  as name spaces for the Statistics produced by them. The `get_stats` method
  will automatically prepend `name` to all of the Statistics names before
  returning them.
  
  Args:
    input_type: The type signature this pipeline expects for its inputs.
    output_type: The type signature this pipeline promises its outputs will
        have.
    name: The string name for this instance. This name is accessible through
        the `name` property. Names should be unique across `Pipeline`
        instances. If None (default), the string name of the implementing
        subclass is used.
docstr_tok: ["Constructs","a","`","Pipeline","`","object",".","Subclass","constructors","are","expected","to","call","this","constructor",".","A","type","signature","is","a","Python","class","or","primative","collection","containing","classes",".","Valid","type","signatures","for","`","Pipeline","`","inputs","and","outputs","are","either","a","Python","class",",","or","a","dictionary","mapping","string","names","to","classes",".","An","object","matches","a","type","signature","if","its","type","equals","the","type","signature","(","i.e",".","type","(","'hello","'",")","==","str",")","or",",","if","its","a","collection",",","the","types","in","the","collection","match","(","i.e",".","{","'hello","'",":","'world","'",",","'number","'",":","1234","}","matches","type","signature","{","'hello","'",":","str",",","'number","'",":","int","}",")","`","Pipeline","`","instances","have","(","preferably","unique",")","string","names",".","These","names","act","as","name","spaces","for","the","Statistics","produced","by","them",".","The","`","get_stats","`","method","will","automatically","prepend","`","name","`","to","all","of","the","Statistics","names","before","returning","them",".","Args",":","input_type",":","The","type","signature","this","pipeline","expects","for","its","inputs",".","output_type",":","The","type","signature","this","pipeline","promises","its","outputs","will","have",".","name",":","The","string","name","for","this","instance",".","This","name","is","accessible","through","the","`","name","`","property",".","Names","should","be","unique","across","`","Pipeline","`","instances",".","If","None","(","default",")",",","the","string","name","of","the","implementing","subclass","is","used","."]
code: def __init__(self, input_type, output_type, name=None):
      """Constructs a `Pipeline` object.
  
      Subclass constructors are expected to call this constructor.
  
      A type signature is a Python class or primative collection containing
      classes. Valid type signatures for `Pipeline` inputs and outputs are either
      a Python class, or a dictionary mapping string names to classes. An object
      matches a type signature if its type equals the type signature
      (i.e. type('hello') == str) or, if its a collection, the types in the
      collection match (i.e. {'hello': 'world', 'number': 1234} matches type
      signature {'hello': str, 'number': int})
  
      `Pipeline` instances have (preferably unique) string names. These names act
      as name spaces for the Statistics produced by them. The `get_stats` method
      will automatically prepend `name` to all of the Statistics names before
      returning them.
  
      Args:
        input_type: The type signature this pipeline expects for its inputs.
        output_type: The type signature this pipeline promises its outputs will
            have.
        name: The string name for this instance. This name is accessible through
            the `name` property. Names should be unique across `Pipeline`
            instances. If None (default), the string name of the implementing
            subclass is used.
      """
      # Make sure `input_type` and `output_type` are valid.
      if name is None:
          # This will get the name of the subclass, not "Pipeline".
          self._name = type(self).__name__
      else:
          assert isinstance(name, six.string_types)
          self._name = name
      _assert_valid_type_signature(input_type, "input_type")
      _assert_valid_type_signature(output_type, "output_type")
      self._input_type = input_type
      self._output_type = output_type
      self._stats = []
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import inspect
  import os.path
  from magenta.pipelines import statistics
  import six
  import tensorflow.compat.v1
label_desc: Use image node_id 1 to create a new Pipeline object from inherited base classes: object with example: obj = Pipeline(input_type, output_type, name)