MCPcopy Create free account
hub / github.com/apache/tvm / clip

Function clip

python/tvm/relax/op/unary.py:529–550  ·  view source on GitHub ↗

Clips tensor values to a specified min and max. Parameters ---------- x : relax.Expr The input data min : relax.Expr The minimum value max : relax.Expr The maximum value Returns ------- result : relax.Expr The computed result.

(x: Expr, min: Expr, max: Expr)

Source from the content-addressed store, hash-verified

527
528
529def clip(x: Expr, min: Expr, max: Expr) -> Expr:
530 """Clips tensor values to a specified min and max.
531
532 Parameters
533 ----------
534 x : relax.Expr
535 The input data
536
537 min : relax.Expr
538 The minimum value
539
540 max : relax.Expr
541 The maximum value
542
543 Returns
544 -------
545 result : relax.Expr
546 The computed result.
547 """
548 min = convert_to_expr(min)
549 max = convert_to_expr(max)
550 return _ffi_api.clip(x, min, max) # type: ignore
551
552
553def erf(x: Expr) -> Expr:

Callers

nothing calls this directly

Calls 1

convert_to_exprFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…