Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
include message in NotImplementedError
  • Loading branch information
t-vi committed Jun 19, 2025
commit 3ffb7940719e7fd4a7d714bf8111b00591e4003f
18 changes: 12 additions & 6 deletions thunder/core/proxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -1688,20 +1688,26 @@ def __trunc__(self):
return method(self)

#
# dtype conversion operators
# conversion operators to numbers - not implemented
#

def __complex__(self):
raise NotImplementedError
raise NotImplementedError(
f"casting a {type(self).__name__} to a Python complex number is not supported (data dependency)"
)

def __float__(self):
raise NotImplementedError
raise NotImplementedError(
f"casting a {type(self).__name__} to a Python float is not supported (data dependency)"
)

def __int__(self):
raise NotImplementedError
raise NotImplementedError(f"casting a {type(self).__name__} to a Python int is not supported (data dependency)")

def __bool__(self):
raise NotImplementedError
raise NotImplementedError(
f"casting a {type(self).__name__} to a Python boolean is not supported (data dependency)"
)

#
# Elementwise binary operators
Expand Down Expand Up @@ -2090,7 +2096,7 @@ def proxy(x: Any, *, name: str | None = None, history: None | tuple = None) -> A
if isinstance(x, int):
return IntegerProxy(name=name, value=x, history=history)

raise NotImplementedError
raise NotImplementedError(f"cannot proxy {type(x).__name__}")

if isinstance(x, tuple):
return TupleProxy(x, name=name, history=history)
Expand Down
Loading