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

Meta type class defining tensor shapes #2

Open
addisonklinke opened this issue Jan 29, 2021 · 0 comments
Open

Meta type class defining tensor shapes #2

addisonklinke opened this issue Jan 29, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@addisonklinke
Copy link
Owner

Is your feature request related to a problem? Please describe
To clearly define the expected inputs/outputs for a given nn.Module, it would be convenient to create a wrapper class for torch.Tensor that encapsulates shape schema and allows for comparisons

Describe the solution you'd like
Create a class called torcharch.types.TensorShape which is initialized with the tensor dimensionality as well any restrictions on the valid range of values each dimension can take on. This can be useful for several cases

  1. Custom modules should define a valid input/output @property
  2. End users can use this interface to check their work
  3. Schema can also be used to conduct dynamic unit tests

Describe alternatives you've considered

  1. The main alternative would be using the built-in tensor class to define a dummy example. However, this is limiting in that the object can't contain schema information about the acceptable range of values in each dimension
  2. It does not appear that PyTorch includes a class like this currently, although that would be preferable
@addisonklinke addisonklinke added the enhancement New feature or request label Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant