parrt / tensor-sensor

The goal of this library is to generate more helpful exception messages for matrix algebra expressions for numpy, pytorch, jax, tensorflow, keras, fastai.
https://github.com/parrt/tensor-sensor
MIT License
771 stars 39 forks source link

Do not create (...) subexpr nodes in AST #24

Closed parrt closed 3 years ago

parrt commented 3 years ago

Fixes #22

This generally resulted in cleaner code and so was a worthwhile improvement. Basically we never want sub expression nodes in the AST so might as well get rid of that. I took the opportunity to change the way sub expression text is computed. Now each node has a pointer to the parser that created it which of course has access to the code it is parsing.