def nest ( thing ) : tfutil = util . get_module ( 'tensorflow.python.util' ) if tfutil : return tfutil . nest . flatten ( thing ) else : return [ thing ]
construct tensorflow tensor from python list
Use tensorflows nest function if available otherwise just wrap object in an array
def nest(thing):
    """Use tensorflows nest function if available, otherwise just wrap object in an array"""
    tfutil = util.get_module('tensorflow.python.util')
    if tfutil:
        return tfutil.nest.flatten(thing)
    else:
        return [thing]