데이터에서 원하는 데이터만 수집하기위한 클래스
args:
collect_keys (list[str]): 수집을 원하는 데이터의 키
Definition at line 84 of file formatting.py.
◆ __init__()
| formatting.CollectKeys.__init__ |
( |
| self, |
|
|
| collect_keys ) |
Definition at line 90 of file formatting.py.
90 def __init__(self, collect_keys):
91 self.collect_keys = collect_keys
92
◆ __call__()
| formatting.CollectKeys.__call__ |
( |
| self, |
|
|
| sample ) |
Definition at line 93 of file formatting.py.
93 def __call__(self, sample):
94
95
96 for key in collect_keys:
97 assert key in sample, \
98 f'CollectKeys : not found key in sample : {key}'
99
100
101 pack_data = {}
102 for key in collect_keys:
103 pack_data[key] = sample[key]
104
105 return pack_data
106
107
◆ collect_keys
| formatting.CollectKeys.collect_keys |
The documentation for this class was generated from the following file: