Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions cuequivariance_torch/cuequivariance_torch/primitives/triangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,15 @@ def triangle_multiplicative_update(
norm_in_weight: Optional[torch.Tensor] = None,
norm_in_bias: Optional[torch.Tensor] = None,
p_in_weight: Optional[torch.Tensor] = None,
p_in_bias: Optional[torch.Tensor] = None,
g_in_weight: Optional[torch.Tensor] = None,
g_in_bias: Optional[torch.Tensor] = None,
norm_out_weight: Optional[torch.Tensor] = None,
norm_out_bias: Optional[torch.Tensor] = None,
p_out_weight: Optional[torch.Tensor] = None,
p_out_bias: Optional[torch.Tensor] = None,
g_out_weight: Optional[torch.Tensor] = None,
g_out_bias: Optional[torch.Tensor] = None,
eps: float = 1e-5,
precision: Optional[TriMulPrecision] = None,
) -> torch.Tensor:
Expand Down Expand Up @@ -167,11 +171,15 @@ def triangle_multiplicative_update(
norm_in_weight (torch.Tensor): Weight tensor for input normalization of shape (D,).
norm_in_bias (torch.Tensor): Bias tensor for input normalization of shape (D,).
p_in_weight (torch.Tensor): Weight tensor for input projection of shape (2D, D).
p_in_bias (torch.Tensor): Bias tensor for input projection of shape (D,).
g_in_weight (torch.Tensor): Weight tensor for input gating of shape (2D, D).
g_in_bias (torch.Tensor): Bias tensor for input gating of shape (D,).
norm_out_weight (torch.Tensor): Weight tensor for output normalization of shape (D,).
norm_out_bias (torch.Tensor): Bias tensor for output normalization of shape (D,).
p_out_weight (torch.Tensor): Weight tensor for output projection of shape (D, D).
p_out_bias (torch.Tensor): Bias tensor for output projection of shape (D,).
g_out_weight (torch.Tensor): Weight tensor for output gating of shape (D, D).
g_out_bias (torch.Tensor): Bias tensor for output gating of shape (D,).
eps (float, optional): Small constant for numerical stability in normalization. Defaults to 1e-5.
precision (Precision, optional): Precision mode for matrix multiplications. If None, uses TF32 if enabled in PyTorch using torch.backends.cuda.matmul.allow_tf32, otherwise uses default precision.
Available options:
Expand Down Expand Up @@ -223,15 +231,19 @@ def triangle_multiplicative_update(
return f(
x,
direction,
mask,
norm_in_weight,
norm_in_bias,
p_in_weight,
g_in_weight,
norm_out_weight,
norm_out_bias,
p_out_weight,
g_out_weight,
eps,
precision,
mask=mask,
norm_in_weight=norm_in_weight,
norm_in_bias=norm_in_bias,
p_in_weight=p_in_weight,
p_in_bias=p_in_bias,
g_in_weight=g_in_weight,
g_in_bias=g_in_bias,
norm_out_weight=norm_out_weight,
norm_out_bias=norm_out_bias,
p_out_weight=p_out_weight,
p_out_bias=p_out_bias,
g_out_weight=g_out_weight,
g_out_bias=g_out_bias,
eps=eps,
precision=precision,
)