Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MidiDataset optimizations #68

Merged
merged 11 commits into from
Nov 22, 2023
Prev Previous commit
Next Next commit
classmethod+property is better...
  • Loading branch information
honglu2875 committed Nov 10, 2023
commit deec979fa8a13c66c9f314b286bbe9444597b1db
5 changes: 3 additions & 2 deletions aria/data/midi.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ def __init__(
}
]

@functools.cached_property
def program_to_instrument(self):
@classmethod
@property
def program_to_instrument(cls):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this is here to speed up the process of building MidiDatasets. Does it make much of a difference?

# This combines the individual dictionaries into one
return (
{i: "piano" for i in range(0, 7 + 1)}
Expand Down