Closed grayicon closed 1 year ago
Thank you for the report. Currently, the main branch contains significant amount of unfinished work not released to PyPI, so bugs are expected, and use it at your own risk.
P.S. The formatted version of the above bug report:
instead of this:
is_last_bin = bin_indices + 1 == torch.as_tensor(list(map(len, bin_edges)))
it should be this:
is_last_bin = bin_indices + 1 == torch.as_tensor(list(map(len, bin_edges))).unsqueeze(-1))
@grayicon is it actually a bug?
bin_indices + 1
has the shape (n_objects, n_features)
as_tensor(list(map(len, bin_edges)))
has the shape (n_features,)
is_last_bin
has the shape (n_objects, n_features)
Feel free to reopen the issue if needed.
@grayicon is it actually a bug?
bin_indices + 1
has the shape(n_objects, n_features)
as_tensor(list(map(len, bin_edges)))
has the shape(n_features,)
- According to broadcasting rules, the result
is_last_bin
has the shape(n_objects, n_features)
The above desc is right in theory, but in fact i found the real bug lie in the line #590 of rtdl.data.py "bin_edges = torch.as_tensor(bin_ratios)", which cause the state "as_tensor(list(map(len, bin_edges)))" has the shape (n_objects,)
So it seems to be the issue reported here, right?
So it should be now resolved by https://github.com/Yura52/rtdl/commit/7929497c6f37f4cd738ffcd5584642cb1d016ae3
Please, let me know if the issue still there
So it should be now resolved by 7929497
Please, let me know if the issue still there
The bin_egdes is a list of torch tensor, So it doesn't support the opera of 'torch.as_tensor'. Consequently, I just comment this line "bin_edges = torch.as_tensor(bin_ratios)", and it will works when call of "map(len, bin_edges) below".
@grayicon oh, I think now I understand. I removed this line in this commit. Does it look good now?
@grayicon oh, I think now I understand. I removed this line in this commit. Does it look good now?
Yes,It can work now, Thanks for your effort.
"is_last_bin = bin_indices + 1 == torch.as_tensor(list(map(len, bin_edges)))is_last_bin = bin_indices + 1 == torch.as_tensor(list(map(len, bin_edges)))" should be "is_last_bin = bin_indices + 1 == torch.as_tensor(list(map(len, bin_edges)))is_last_bin = bin_indices + 1 == torch.as_tensor(list(map(len, bin_edges))).unsqueeze(-1))", to use tensor broadcast func