MCPcopy Create free account
hub / github.com/OpenGVLab/EfficientQAT / forward

Method forward

quantize/utils.py:83–86  ·  view source on GitHub ↗
(ctx, input, threshold)

Source from the content-addressed store, hash-verified

81class 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected