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

Type checking on sample for num_samples #451

Closed
11 tasks
sabinala opened this issue Jan 10, 2024 · 1 comment · Fixed by #455
Closed
11 tasks

Type checking on sample for num_samples #451

sabinala opened this issue Jan 10, 2024 · 1 comment · Fixed by #455
Assignees
Labels
enhancement New feature or request

Comments

@sabinala
Copy link
Contributor

Need several tests for num_samples:

  • num_samples = 3 as an int
  • num_samples = 3.0 as a 'float`
  • num_samples = 3.1 as a 'float`
  • num_samples = torch.tensor(3) as tensor
  • num_samples = torch.tensor([3]) as tensor
  • num_samples = torch.tensor(3.0) as tensor
  • num_samples = torch.tensor([3.0]) as tensor
  • num_samples = None
  • num_samples = -3
  • num_samples = "a"
  • num_samples = [3, 4, 5] as an array

We check that the output either "fails gracefully" with an informative error message, or warns us that it has converted to an int.

@sabinala sabinala added the enhancement New feature or request label Jan 10, 2024
@sabinala
Copy link
Contributor Author

Simplest solution: throw an informative error if input to num_samples is not a positive int.

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

Successfully merging a pull request may close this issue.

2 participants