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
[Improvement] Make index errors while accessing Dataset and Tensor easier to understand. #1560
Comments
|
Hello! Do we wish to output the details of the tensor that did not have the index specified? I am guessing that would be much more helpful in debugging. |
|
Hey @neel2299! We can certainly display the tensor name in case the error we're catching is happening while indexing into a tensor. |
|
we can use if-else statements for this to show if the length is greater than 10 then show up the error |
|
can you assign this to me i want to work in this |
|
Is this issue available? |
|
@AbhinavTuli Do I have to raise an exception in the |
|
Like this :- if isinstance(item, str):
if(Index > self.__len__):
raise IndexError("Index out of range")
else:
fullpath = posixpath.join(self.group_index, item)
tensor = self._get_tensor_from_root(fullpath) |
aadityasinha-dotcom
mentioned this issue

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.


Is your feature request related to a problem?
Currently, if a user tries to access an index that is larger than the dataset length or tensor length, an internal error is thrown which is not easy to understand.
Description of the possible solution
We can catch the error and throw a more descriptive error that's easier to understand.
Example of when the error is thrown:-
The text was updated successfully, but these errors were encountered: