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

Function _compute

python/tvm/topi/math.py:635–647  ·  view source on GitHub ↗
(*indices)

Source from the content-addressed store, hash-verified

633 """
634
635 def _compute(*indices):
636 value = x(*indices)
637 const_min = (
638 tvm.tirx.Cast(value.dtype, a_min)
639 if isinstance(a_min, PrimExpr)
640 else tvm.tirx.const(a_min, value.dtype)
641 )
642 const_max = (
643 tvm.tirx.Cast(value.dtype, a_max)
644 if isinstance(a_max, PrimExpr)
645 else tvm.tirx.const(a_max, value.dtype)
646 )
647 return tvm.te.max(tvm.te.min(value, const_max), const_min)
648
649 return te.compute(x.shape, _compute)
650

Callers

nothing calls this directly

Calls 5

get_const_tupleFunction · 0.85
tupleFunction · 0.85
lshiftFunction · 0.85
maxMethod · 0.80
minMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…