Get the product of every items in the tuple. Parameters ---------- x: tuple Input tuple Returns ------- value : Expr The result value
(x)
| 84 | |
| 85 | |
| 86 | def prod(x): |
| 87 | """Get the product of every items in the tuple. |
| 88 | |
| 89 | Parameters |
| 90 | ---------- |
| 91 | x: tuple |
| 92 | Input tuple |
| 93 | |
| 94 | Returns |
| 95 | ------- |
| 96 | value : Expr |
| 97 | The result value |
| 98 | """ |
| 99 | if not x: |
| 100 | return tvm.tirx.const(1, "int32") |
| 101 | res = x[0] |
| 102 | for i in range(1, len(x)): |
| 103 | res = res * x[i] |
| 104 | return res |
| 105 | |
| 106 | |
| 107 | def get_const_int(expr): |
no outgoing calls
no test coverage detected
searching dependent graphs…