-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[fix] check for histogramdd when bins is int[] #100624
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2748,6 +2748,12 @@ def sample_inputs_histogramdd(op_info, device, dtype, requires_grad, **kwargs): | |
yield SampleInput(input_tensor, bins_tensor, | ||
weight=weight_tensor, density=density) | ||
|
||
def error_inputs_histogramdd(opinfo, device, **kwargs): | ||
invalid_bins = [1, 1, 1, 1, 1] | ||
make_arg = partial(make_tensor, dtype=torch.float, device=device, requires_grad=False) | ||
msg = "histogramdd: The size of bins must be equal to the innermost dimension of the input." | ||
yield ErrorInput(SampleInput(make_arg(5, 6), invalid_bins), error_regex=msg) | ||
|
||
def sample_inputs_histc(op_info, device, dtype, requires_grad, **kwargs): | ||
make_arg = partial(make_tensor, dtype=dtype, device=device, requires_grad=requires_grad) | ||
|
||
|
@@ -16024,8 +16030,11 @@ def reference_flatten(input, start_dim=0, end_dim=-1): | |
dtypes=floating_types(), | ||
dtypesIfCUDA=_dispatch_dtypes(), # histogramdd is only implemented on CPU | ||
sample_inputs_func=sample_inputs_histogramdd, | ||
error_inputs_func=error_inputs_histogramdd, | ||
supports_autograd=False, | ||
skips=( | ||
# Not implemented on CUDA | ||
DecorateInfo(unittest.expectedFailure, 'TestCommon', 'test_errors', device_type='cuda'), | ||
Comment on lines
+16036
to
+16037
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add it for the cuda path now that we're at it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This operator is not implemented for CUDA. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a bug in the implementation of |
||
DecorateInfo(unittest.expectedFailure, 'TestNormalizeOperators', 'test_normalize_operator_exhaustive'), | ||
# JIT tests don't work with Tensor keyword arguments | ||
# https://github.com/pytorch/pytorch/issues/58507 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd end up reading garbage value for
bin_ct[dim]
for dim > bin_size.