You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
335 B
14 lines
335 B
3 years ago
|
try:
|
||
3 years ago
|
from torch import _assert
|
||
3 years ago
|
except ImportError:
|
||
3 years ago
|
def _assert(condition: bool, message: str):
|
||
|
assert condition, message
|
||
3 years ago
|
|
||
|
|
||
|
def _float_to_int(x: float) -> int:
|
||
|
"""
|
||
|
Symbolic tracing helper to substitute for inbuilt `int`.
|
||
|
Hint: Inbuilt `int` can't accept an argument of type `Proxy`
|
||
|
"""
|
||
|
return int(x)
|