Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions aten/src/ATen/Declarations.cwrap
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,7 @@
variants:
- function
return: argument 0
scalar_check: false
arguments:
- arg: THTensor* result
output: True
Expand Down
7 changes: 7 additions & 0 deletions test/test_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2646,6 +2646,13 @@ def test_histc(self):
torch.tensor([0, 2, 1, 0], dtype=torch.float, device=device),
actual)
self.assertEqual(actual.dtype, torch.float)
# scalar input and 1 bin -- should return a 1-dimensional tensor, not a scalar.
actual = torch.histc(
torch.tensor(0, dtype=torch.float, device=device),
bins=1, min=0, max=3)
self.assertEqual(
torch.tensor([1], dtype=torch.float, device=device),
actual)

# test against numpy.histogram()
def test_against_np(tensor, bins=100, min=0, max=0):
Expand Down