brainstate.nn.init_maybe_prefetch#
- brainstate.nn.init_maybe_prefetch(target, *args, **kwargs)[source]#
Initialize a prefetch target if needed, based on its type.
This function ensures that prefetch references are properly initialized and ready to use. It handles different types of prefetch objects by performing the appropriate initialization action: - For
Prefetchobjects: retrieves the referenced item - ForPrefetchDelayobjects: retrieves the delay handler - ForPrefetchDelayAtobjects: registers the specified delay- Parameters:
- Returns:
This function performs initialization side effects only.
- Return type:
Notes
This function is typically called internally when prefetched references are used to ensure they are properly set up before access.