Update _utils.py
This commit is contained in:
parent
a62651ce69
commit
ef368f7858
1 changed files with 6 additions and 6 deletions
|
|
@ -1178,14 +1178,14 @@ LOGITS_ERROR_STRING = \
|
|||
def raise_logits_error(*args, **kwargs): raise NotImplementedError(LOGITS_ERROR_STRING)
|
||||
class EmptyLogits:
|
||||
def __init__(self): return
|
||||
# __getitem__ = raise_logits_error
|
||||
# __getattr__ = raise_logits_error
|
||||
__getitem__ = raise_logits_error
|
||||
__getattr__ = raise_logits_error
|
||||
def __repr__(self): return LOGITS_ERROR_STRING
|
||||
def __str__ (self): return LOGITS_ERROR_STRING
|
||||
pass
|
||||
EMPTY_LOGITS = EmptyLogits()
|
||||
functions = dir(torch.Tensor)
|
||||
for function in functions:
|
||||
try: exec(f"EMPTY_LOGITS.{function} = raise_logits_error", globals(), locals())
|
||||
except: continue
|
||||
pass
|
||||
# for function in functions:
|
||||
# try: exec(f"EMPTY_LOGITS.{function} = raise_logits_error", globals(), locals())
|
||||
# except: continue
|
||||
# pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue