tfx.v1.dsl.Cond

Cond context manager that disable containing nodes if predicate is False.

Cond blocks can be nested to express the nested conditions.

evaluator = Evaluator( examples=example_gen.outputs['examples'], model=trainer.outputs['model'], eval_config=EvalConfig(...))

with Cond(evaluator.outputs['blessing'].future() .custom_property('blessed') == 1): pusher = Pusher( model=trainer.outputs['model'], push_destination=PushDestination(...))

Methods

create_context

Creates an underlying DslContext object.

All nodes defined within this DslContextManager would be associated with the created DslContext.

Since DslContextManager can enter multiple times and each represents a different context, the return value should be newly created (not reused).

Returns
Newly created DslContext object.

enter

Subclass hook method for enter.

Returned value is captured at "with..as" clause. It can be any helper object to augment DSL syntax.

Args
context Newly created DslContext that DslContextManager has created for the enter().

__enter__

__exit__