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

pip install submodule to avoid install all dependecies #3

Closed noklam closed 3 years ago

noklam commented 3 years ago

Very often, people already have the tensor library they are using, keras, torch, tensorflow if they are coming for this library. Currently, the package tries to install all dependencies. For example, if I am using PyTorch, I don't really need to install the big TensorFlow library in the environment.

Added options

 pip install tensor-sensor[all]
 pip install tensor-sensor[torch]
 pip install tensor-sensor[tensorflow]
parrt commented 3 years ago

Yes, I was worried about the heavy installs. Does your setup.py solve this? Can't tell from reading it.

noklam commented 3 years ago

Fixed the typo extra_requires => extras_require. This change will make the default behaviour pip install not installing PyTorch or TensorFlow, only when specified with the [torch] syntax, it will pull the related dependency, which is "torch" only for now.

pip install tensor-sensor # This will only install the library for you
pip install tensor-sensor[torch] # install pytorch related depedency
pip install tensor-sensor[tensorflow] # install tensorflow related depedency
pip install tensor-sensor[all] # install both tensorflow and pytorch
parrt commented 3 years ago

thanks very much! I had no idea this feature existed for setup.py. haha

parrt commented 3 years ago

There appears to be an install issue still: https://github.com/parrt/tensor-sensor/issues/8