hls4ml.model.flow package
Submodules
hls4ml.model.flow.flow module
- class hls4ml.model.flow.flow.DynamicFlow(name, optimizer_func, requires=None)
Bases:
Flow
A dynamically updated flow.
This flow will get the list of optimizers by calling optimizer_func. Useful to represent a view of all available optimizers of a certain type.
- property optimizers
- class hls4ml.model.flow.flow.Flow(name, optimizers, requires=None)
Bases:
object
This class represents a collection of optimizers. The flow can optionally depend on other flows.
- property optimizers
- hls4ml.model.flow.flow.get_available_flows()
- hls4ml.model.flow.flow.get_backend_flows(backend)
- hls4ml.model.flow.flow.get_flow(name)
- hls4ml.model.flow.flow.register_flow(name, optimizers, requires=None, backend=None)
Create a flow and add it to the registry.
- Parameters:
name (str) – _description_
optimizers (list) – List of optimizers.
requires (list, optional) – List (str) of flows which have to be applied before this flow. Defaults to None.
backend (str, optional) – Backend to which the flow will belong. If not None, the name of the backend will be appended to the name of the registered flow. Defaults to None.
- Raises:
Exception – If the flow has already been registered.
- Returns:
The name of the registered flow.
- Return type:
str
- hls4ml.model.flow.flow.update_flow(flow_name, add_optimizers=None, remove_optimizers=None)
Add or remove optimizers to/from an existing flow.
- Parameters:
flow_name (str) – The name of the flow to update.
add_optimizers (list, optional) – List (str) of optimizers to add. Defaults to None.
remove_optimizers (list, optional) – List (str) of optimizers to remove. Defaults to None.