gpflow.utilities.utilities

gpflow.utilities.utilities.traverse_module

gpflow.utilities.utilities.traverse_module(m: ~TraverseInput, acc: Tuple[str, Any], update_cb: Callable[[~TraverseInput, str, Any], Any], target_types: tuple) → Tuple[str, Any][source]

Recursively traverses m, accumulating in acc a path and a state until it finds an object of type in target_types to apply update_cb to update the accumulator acc and/or the object.

Parameters
  • m (~TraverseInput) – tf.Module, tf.Variable or gpflow.Parameter

  • acc (Tuple[str, Any]) – Tuple of path and state

  • update_cb (Callable[[~TraverseInput, str, Any], Any]) – Callable

  • target_types (tuple) – target class types

Return type

Tuple[str, Any]

Returns