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

#378 Feature/sg 281 add kd notebook

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:feature/SG-281-add_kd_notebook
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  1. from typing import List, Sequence
  2. from super_gradients.common.factories.base_factory import AbstractFactory
  3. class ListFactory(AbstractFactory):
  4. def __init__(self, factry: AbstractFactory):
  5. self.factry = factry
  6. def get(self, conf_list: List):
  7. if isinstance(conf_list, Sequence):
  8. all = []
  9. for conf in conf_list:
  10. all.append(self.factry.get(conf))
  11. return all
  12. else:
  13. # FALLBACK - IN CASE LIST OF TYPE OR TYPE ARE BOTH EXPECTED
  14. return self.factry.get(conf_list)
Discard
Tip!

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