MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / get_activation

Function get_activation

diffsynth/models/stepvideo_dit.py:86–100  ·  view source on GitHub ↗

Helper function to get activation function from string. Args: act_fn (str): Name of activation function. Returns: nn.Module: Activation function.

(act_fn: str)

Source from the content-addressed store, hash-verified

84
85
86def get_activation(act_fn: str) -> nn.Module:
87 """Helper function to get activation function from string.
88
89 Args:
90 act_fn (str): Name of activation function.
91
92 Returns:
93 nn.Module: Activation function.
94 """
95
96 act_fn = act_fn.lower()
97 if act_fn in ACTIVATION_FUNCTIONS:
98 return ACTIVATION_FUNCTIONS[act_fn]
99 else:
100 raise ValueError(f"Unsupported activation function: {act_fn}")
101
102
103def get_timestep_embedding(

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected