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)
| 527 | |
| 528 | |
| 529 | def 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 | |
| 553 | def erf(x: Expr) -> Expr: |
nothing calls this directly
no test coverage detected
searching dependent graphs…