Make it possible to comment out lines with hash in expressions
This commit is contained in:
@@ -97,6 +97,11 @@ class Expression:
|
||||
|
||||
@classmethod
|
||||
def tokenize(cls, s):
|
||||
s = "\n".join(
|
||||
line.rstrip("\r")
|
||||
for line in s.split("\n")
|
||||
if not line.lstrip().startswith("#")
|
||||
)
|
||||
yield from (cls.fixup_token(m.group(1)) for m in cls.EXPR_RE.finditer(s))
|
||||
|
||||
|
||||
|
||||
@@ -159,7 +159,6 @@ class NewLikeHandler(NormHandler):
|
||||
|
||||
def handle(self, obj, getter):
|
||||
tensor, values = self.safe_get_all(obj, getter)
|
||||
print(f"\nNEW TENSOR: {values}")
|
||||
return torch.tensor(values, dtype=tensor.dtype, device=tensor.device)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user