torchsig.models.model_utils.layer_tools.replace_layers_on_condition

torchsig.models.model_utils.layer_tools.replace_layers_on_condition(model, condition_fn, new_layer_factory_fn)[source]

search through model finding all layers L such that conditional_fn(L), and replace them with new_layer_factory_fn(L) returns true if at least one layer was replaced; false otherwise