torch.ops.tvarant.linear_act¶
torch.ops.tvarant.linear_act(x, weight, bias, act, trans_b=False) → Tensor
Fused GEMM + optional bias + activation. Used by the graph compiler for Linear+ReLU/SiLU epilogues.
Parameters¶
- x (
Tensor) – Activations(..., K). - weight (
Tensor) – Weight matrix. - bias (
Tensor or None) – Optional bias. - act (
str) –"none","relu", or"silu". - trans_b (
bool) – IfTrue, treat weight likenn.Linear(A^T). Default:False.
Shape¶
- Output:
(..., N)whereNis the output feature size
Example¶
y = torch.ops.tvarant.linear_act(x, w, b, 'relu', True)