Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

dataset_exceptions.py 894 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  1. class IllegalDatasetParameterException(Exception):
  2. """
  3. Exception raised illegal dataset param.
  4. Attributes:
  5. message -- explanation of the error
  6. """
  7. def __init__(self, desc):
  8. self.message = "Unsupported dataset parameter format: " + desc
  9. super().__init__(self.message)
  10. class UnsupportedBatchItemsFormat(ValueError):
  11. """Exception raised illegal batch items returned from data loader.
  12. Attributes:
  13. message -- explanation of the error
  14. """
  15. def __init__(self):
  16. self.message = "Batch items returned by the data loader expected format: \n" \
  17. "1. torch.Tensor or tuple, s.t inputs = batch_items[0], targets = batch_items[1] and len(" \
  18. "batch_items) = 2 \n" \
  19. "2. tuple: (inputs, targets, additional_batch_items)"
  20. super().__init__(self.message)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...