def __setstate__(self, d): Parameterized.__setstate__(self, d) self._needs_recompile = True self._session = tf.Session()