(ctx, input, threshold)
| 81 | class TruncateFunction(torch.autograd.Function): |
| 82 | @staticmethod |
| 83 | def forward(ctx, input, threshold): |
| 84 | truncated_tensor = input.clone() |
| 85 | truncated_tensor[truncated_tensor.abs() < threshold] = truncated_tensor[truncated_tensor.abs() < threshold].sign() * threshold |
| 86 | return truncated_tensor |
| 87 | |
| 88 | |
| 89 | @staticmethod |
nothing calls this directly
no outgoing calls
no test coverage detected