code-loader 1.0.52__py3-none-any.whl → 1.0.55__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- code_loader/inner_leap_binder/leapbinder_decorators.py +12 -12
- {code_loader-1.0.52.dist-info → code_loader-1.0.55.dist-info}/METADATA +1 -1
- {code_loader-1.0.52.dist-info → code_loader-1.0.55.dist-info}/RECORD +5 -5
- {code_loader-1.0.52.dist-info → code_loader-1.0.55.dist-info}/LICENSE +0 -0
- {code_loader-1.0.52.dist-info → code_loader-1.0.55.dist-info}/WHEEL +0 -0
@@ -93,17 +93,17 @@ def tensorleap_custom_visualizer(name: str, visualizer_type: LeapDataType,
|
|
93
93
|
assert isinstance(arg, np.ndarray), (f'tensorleap_custom_visualizer validation failed: '
|
94
94
|
f'Argument #{i} should be a numpy array. Got {type(arg)}.')
|
95
95
|
if leap_binder.batch_size_to_validate:
|
96
|
-
assert arg.shape[0]
|
97
|
-
(f'tensorleap_custom_visualizer validation failed:
|
98
|
-
f'
|
96
|
+
assert arg.shape[0] != leap_binder.batch_size_to_validate, \
|
97
|
+
(f'tensorleap_custom_visualizer validation failed: '
|
98
|
+
f'Argument #{i} should be without batch dimension. ')
|
99
99
|
|
100
100
|
for _arg_name, arg in kwargs.items():
|
101
101
|
assert isinstance(arg, np.ndarray), (f'tensorleap_custom_visualizer validation failed: '
|
102
102
|
f'Argument {_arg_name} should be a numpy array. Got {type(arg)}.')
|
103
103
|
if leap_binder.batch_size_to_validate:
|
104
|
-
assert arg.shape[0]
|
104
|
+
assert arg.shape[0] != leap_binder.batch_size_to_validate, \
|
105
105
|
(f'tensorleap_custom_visualizer validation failed: Argument {_arg_name} '
|
106
|
-
f'
|
106
|
+
f'should be without batch dimension. ')
|
107
107
|
|
108
108
|
def _validate_result(result):
|
109
109
|
result_type_map = {
|
@@ -279,7 +279,7 @@ def tensorleap_gt_encoder(name: str):
|
|
279
279
|
def decorating_function(user_function: SectionCallableInterface):
|
280
280
|
for gt_handler in leap_binder.setup_container.ground_truths:
|
281
281
|
if gt_handler.name == name:
|
282
|
-
raise Exception(f'
|
282
|
+
raise Exception(f'GT with name {name} already exists. '
|
283
283
|
f'Please choose another')
|
284
284
|
|
285
285
|
leap_binder.set_ground_truth(user_function, name)
|
@@ -319,7 +319,7 @@ def tensorleap_custom_loss(name: str):
|
|
319
319
|
def decorating_function(user_function: CustomCallableInterface):
|
320
320
|
for loss_handler in leap_binder.setup_container.custom_loss_handlers:
|
321
321
|
if loss_handler.name == name:
|
322
|
-
raise Exception(f'
|
322
|
+
raise Exception(f'Custom loss with name {name} already exists. '
|
323
323
|
f'Please choose another')
|
324
324
|
|
325
325
|
leap_binder.add_custom_loss(user_function, name)
|
@@ -327,8 +327,8 @@ def tensorleap_custom_loss(name: str):
|
|
327
327
|
def _validate_input_args(*args, **kwargs):
|
328
328
|
try:
|
329
329
|
import tensorflow as tf
|
330
|
-
except ImportError:
|
331
|
-
raise Exception('the input arguments of the custom loss function should be tensorflow tensors')
|
330
|
+
except ImportError as e:
|
331
|
+
raise Exception('the input arguments of the custom loss function should be tensorflow tensors') from e
|
332
332
|
|
333
333
|
for i, arg in enumerate(args):
|
334
334
|
assert isinstance(arg, tf.Tensor), (f'tensorleap_custom_loss validation failed: '
|
@@ -367,11 +367,11 @@ def tensorleap_custom_layer(name: str):
|
|
367
367
|
|
368
368
|
try:
|
369
369
|
import tensorflow as tf
|
370
|
-
except ImportError:
|
371
|
-
raise Exception('
|
370
|
+
except ImportError as e:
|
371
|
+
raise Exception('Custom layer should be inherit from tf.keras.layers.Layer') from e
|
372
372
|
|
373
373
|
if not issubclass(custom_layer, tf.keras.layers.Layer):
|
374
|
-
raise Exception('
|
374
|
+
raise Exception('Custom layer should be inherit from tf.keras.layers.Layer')
|
375
375
|
|
376
376
|
leap_binder.set_custom_layer(custom_layer, name)
|
377
377
|
|
@@ -19,12 +19,12 @@ code_loader/experiment_api/utils.py,sha256=XZHtxge12TS4H4-8PjV3sKuhp8Ud6ojAiIzTZ
|
|
19
19
|
code_loader/experiment_api/workingspace_config_utils.py,sha256=DLzXQCg4dgTV_YgaSbeTVzq-2ja_SQw4zi7LXwKL9cY,990
|
20
20
|
code_loader/inner_leap_binder/__init__.py,sha256=koOlJyMNYzGbEsoIbXathSmQ-L38N_pEXH_HvL7beXU,99
|
21
21
|
code_loader/inner_leap_binder/leapbinder.py,sha256=35hyesDdmjOD9wdrTLyayb-vm9aDfmEbMA0c4EQR1LA,25090
|
22
|
-
code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=
|
22
|
+
code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=bBzIPx9DvPGzVTZcjUqCRkTT5GhH6cL5PsjmTtawJhE,19054
|
23
23
|
code_loader/leaploader.py,sha256=POUgD6x1GH_iF_eDGz-VLX4DsIl2kddufKVDdrA_K-U,19491
|
24
24
|
code_loader/utils.py,sha256=aw2i_fqW_ADjLB66FWZd9DfpCQ7mPdMyauROC5Nd51I,2197
|
25
25
|
code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
26
26
|
code_loader/visualizers/default_visualizers.py,sha256=VoqO9FN84yXyMjRjHjUTOt2GdTkJRMbHbXJ1cJkREkk,2230
|
27
|
-
code_loader-1.0.
|
28
|
-
code_loader-1.0.
|
29
|
-
code_loader-1.0.
|
30
|
-
code_loader-1.0.
|
27
|
+
code_loader-1.0.55.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
|
28
|
+
code_loader-1.0.55.dist-info/METADATA,sha256=I2IBhfNvtdxQgrU5SLkIpEjam8s4YcwG7f8coQ1TBhk,888
|
29
|
+
code_loader-1.0.55.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
30
|
+
code_loader-1.0.55.dist-info/RECORD,,
|
File without changes
|
File without changes
|