MCPcopy
hub / github.com/NVIDIA/TensorRT-LLM / int_clip

Function int_clip

tensorrt_llm/functional.py:791–795  ·  view source on GitHub ↗
(input: Tensor, lower: int, upper: int)

Source from the content-addressed store, hash-verified

789
790
791def int_clip(input: Tensor, lower: int, upper: int) -> Tensor:
792 assert lower <= upper, f"Lower bound must be less than or equal to upper bound i.e. {lower} <= {upper}"
793 res = minimum(input, upper)
794 res = maximum(res, lower)
795 return res
796
797
798def clip(input: Tensor, alpha: float, beta: float) -> Tensor:

Callers 1

shapeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected