salu133445 / muspy

A toolkit for symbolic music generation
https://salu133445.github.io/muspy/
MIT License
427 stars 49 forks source link

Move PyTorch and TensorFlow supports to separate packages #65

Closed salu133445 closed 3 years ago

salu133445 commented 3 years ago

Currently, importing MusPy will also import PyTorch and TensorFlow if they are installed. However, this greatly reduces the import speed and often results in unnecessary imports. This pull request proposes to move PyTorch and TensorFlow to separate packages as this seems to be the only way to make optional imports possible. We could have a muspy-pytorch and a muspy-tensorflow package for PyTorch and TensorFlow supports.

salu133445 commented 3 years ago

Actually, this seems to be solvable by importing TensorFlow and PyTorch inside function calls.