Function tvm::tirx::DetectLinearEquation

Function tvm::tirx::DetectLinearEquation#

Function Documentation#

ffi::Array<PrimExpr> tvm::tirx::DetectLinearEquation(const PrimExpr &e, const ffi::Array<PrimVar> &vars)#

Detect if e can be rewritten as e = sum_{i=0}^{n-1} var[i] * coeff[i] + coeff[n] Where coeff[i] and base are invariant of var[j] for all i and j.

Parameters:
  • e – The expression to be detected.

  • vars – List of variables to be used in detection.

Returns:

[coeff[i]] if it is possible, empty array if it is not.