View source on GitHub
|
Context manager for tensorflow-transform.
tft_beam.Context(
temp_dir: Optional[str] = None,
desired_batch_size: Optional[int] = None,
passthrough_keys: Optional[Iterable[str]] = None,
use_deep_copy_optimization: Optional[bool] = None,
force_tf_compat_v1: Optional[bool] = None,
save_options: Optional[tf.saved_model.SaveOptions] = None
)
All the attributes in this context are kept on a thread local state. Note that the temp dir should be accessible to worker jobs, e.g. if running with the Cloud Dataflow runner, the temp dir should be on GCS and should have permissions that allow both launcher and workers to access it.
Methods
create_base_temp_dir
@classmethodcreate_base_temp_dir() -> str
Generate a temporary location.
get_desired_batch_size
@classmethodget_desired_batch_size() -> Optional[int]
Retrieves a user set fixed batch size, None if not set.
get_passthrough_keys
@classmethodget_passthrough_keys() -> Iterable[str]
Retrieves a user set passthrough_keys, None if not set.
get_save_options
@classmethodget_save_options() -> Optional[tf.saved_model.SaveOptions]
Retrieves a user set save_options, None if not set.
get_use_deep_copy_optimization
@classmethodget_use_deep_copy_optimization() -> bool
Retrieves a user set use_deep_copy_optimization, None if not set.
get_use_tf_compat_v1
@classmethodget_use_tf_compat_v1() -> bool
Computes use_tf_compat_v1 from TF environment and force_tf_compat_v1.
__enter__
__enter__()
__exit__
__exit__(
*exn_info
)
View source on GitHub