code-loader 1.0.118.dev3__py3-none-any.whl → 1.0.118.dev6__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.
Potentially problematic release.
This version of code-loader might be problematic. Click here for more details.
- code_loader/inner_leap_binder/leapbinder_decorators.py +39 -6
- code_loader/leaploader.py +2 -0
- {code_loader-1.0.118.dev3.dist-info → code_loader-1.0.118.dev6.dist-info}/METADATA +1 -1
- {code_loader-1.0.118.dev3.dist-info → code_loader-1.0.118.dev6.dist-info}/RECORD +6 -6
- {code_loader-1.0.118.dev3.dist-info → code_loader-1.0.118.dev6.dist-info}/LICENSE +0 -0
- {code_loader-1.0.118.dev3.dist-info → code_loader-1.0.118.dev6.dist-info}/WHEEL +0 -0
|
@@ -675,8 +675,6 @@ def tensorleap_input_encoder(name: str, channel_dim=-1, model_input_index=None):
|
|
|
675
675
|
if channel_dim <= 0 and channel_dim != -1:
|
|
676
676
|
raise Exception(f"Channel dim for input {name} is expected to be either -1 or positive")
|
|
677
677
|
|
|
678
|
-
leap_binder.set_input(user_function, name, channel_dim=channel_dim)
|
|
679
|
-
|
|
680
678
|
def _validate_input_args(sample_id: Union[int, str], preprocess_response: PreprocessResponse):
|
|
681
679
|
assert isinstance(sample_id, (int, str)), \
|
|
682
680
|
(f'tensorleap_input_encoder validation failed: '
|
|
@@ -699,15 +697,35 @@ def tensorleap_input_encoder(name: str, channel_dim=-1, model_input_index=None):
|
|
|
699
697
|
assert channel_dim - 1 <= len(result.shape), (f'tensorleap_input_encoder validation failed: '
|
|
700
698
|
f'The channel_dim ({channel_dim}) should be <= to the rank of the resulting input rank ({len(result.shape)}).')
|
|
701
699
|
|
|
700
|
+
def inner_without_validate(sample_id, preprocess_response):
|
|
701
|
+
|
|
702
|
+
global _called_from_inside_tl_decorator
|
|
703
|
+
_called_from_inside_tl_decorator += 1
|
|
704
|
+
|
|
705
|
+
try:
|
|
706
|
+
result = user_function(sample_id, preprocess_response)
|
|
707
|
+
finally:
|
|
708
|
+
_called_from_inside_tl_decorator -= 1
|
|
709
|
+
|
|
710
|
+
return result
|
|
711
|
+
|
|
712
|
+
leap_binder.set_input(inner_without_validate, name, channel_dim=channel_dim)
|
|
713
|
+
|
|
714
|
+
|
|
702
715
|
def inner(sample_id, preprocess_response):
|
|
703
716
|
_validate_input_args(sample_id, preprocess_response)
|
|
704
|
-
|
|
717
|
+
|
|
718
|
+
result = inner_without_validate(sample_id, preprocess_response)
|
|
719
|
+
|
|
705
720
|
_validate_result(result)
|
|
706
721
|
|
|
707
722
|
if _called_from_inside_tl_decorator == 0:
|
|
708
723
|
result = np.expand_dims(result, axis=0)
|
|
724
|
+
|
|
709
725
|
return result
|
|
710
726
|
|
|
727
|
+
|
|
728
|
+
|
|
711
729
|
node_mapping_type = NodeMappingType.Input
|
|
712
730
|
if model_input_index is not None:
|
|
713
731
|
node_mapping_type = NodeMappingType(f'Input{str(model_input_index)}')
|
|
@@ -744,8 +762,6 @@ def tensorleap_gt_encoder(name: str):
|
|
|
744
762
|
raise Exception(f'GT with name {name} already exists. '
|
|
745
763
|
f'Please choose another')
|
|
746
764
|
|
|
747
|
-
leap_binder.set_ground_truth(user_function, name)
|
|
748
|
-
|
|
749
765
|
def _validate_input_args(sample_id: Union[int, str], preprocess_response: PreprocessResponse):
|
|
750
766
|
assert isinstance(sample_id, (int, str)), \
|
|
751
767
|
(f'tensorleap_gt_encoder validation failed: '
|
|
@@ -766,13 +782,30 @@ def tensorleap_gt_encoder(name: str):
|
|
|
766
782
|
(f'tensorleap_gt_encoder validation failed: '
|
|
767
783
|
f'The return type should be a numpy array of type float32. Got {result.dtype}.')
|
|
768
784
|
|
|
785
|
+
def inner_without_validate(sample_id, preprocess_response):
|
|
786
|
+
global _called_from_inside_tl_decorator
|
|
787
|
+
_called_from_inside_tl_decorator += 1
|
|
788
|
+
|
|
789
|
+
try:
|
|
790
|
+
result = user_function(sample_id, preprocess_response)
|
|
791
|
+
finally:
|
|
792
|
+
_called_from_inside_tl_decorator -= 1
|
|
793
|
+
|
|
794
|
+
return result
|
|
795
|
+
|
|
796
|
+
leap_binder.set_ground_truth(inner_without_validate, name)
|
|
797
|
+
|
|
798
|
+
|
|
769
799
|
def inner(sample_id, preprocess_response):
|
|
770
800
|
_validate_input_args(sample_id, preprocess_response)
|
|
771
|
-
|
|
801
|
+
|
|
802
|
+
result = inner_without_validate(sample_id, preprocess_response)
|
|
803
|
+
|
|
772
804
|
_validate_result(result)
|
|
773
805
|
|
|
774
806
|
if _called_from_inside_tl_decorator == 0:
|
|
775
807
|
result = np.expand_dims(result, axis=0)
|
|
808
|
+
|
|
776
809
|
return result
|
|
777
810
|
|
|
778
811
|
inner.node_mapping = NodeMapping(name, NodeMappingType.GroundTruth)
|
code_loader/leaploader.py
CHANGED
|
@@ -77,6 +77,8 @@ class LeapLoader(LeapLoaderBase):
|
|
|
77
77
|
file_path = Path(self.code_path, self.code_entry_name)
|
|
78
78
|
append_path_recursively(str(file_path))
|
|
79
79
|
|
|
80
|
+
importlib.invalidate_caches()
|
|
81
|
+
|
|
80
82
|
spec = importlib.util.spec_from_file_location(self.code_path, file_path)
|
|
81
83
|
if spec is None or spec.loader is None:
|
|
82
84
|
raise DatasetScriptException(f'Something is went wrong with spec file from: {file_path}')
|
|
@@ -21,8 +21,8 @@ code_loader/experiment_api/utils.py,sha256=XZHtxge12TS4H4-8PjV3sKuhp8Ud6ojAiIzTZ
|
|
|
21
21
|
code_loader/experiment_api/workingspace_config_utils.py,sha256=DLzXQCg4dgTV_YgaSbeTVzq-2ja_SQw4zi7LXwKL9cY,990
|
|
22
22
|
code_loader/inner_leap_binder/__init__.py,sha256=koOlJyMNYzGbEsoIbXathSmQ-L38N_pEXH_HvL7beXU,99
|
|
23
23
|
code_loader/inner_leap_binder/leapbinder.py,sha256=Q3D9yVM-GNEJfYRFvMV__BoZbcWOgnWKhrZXAv6Tu7o,33232
|
|
24
|
-
code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=
|
|
25
|
-
code_loader/leaploader.py,sha256=
|
|
24
|
+
code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=r9J_AzZnALJFcyd89Yx_bhsk10QeOfJW1oYp6WmJSIQ,43719
|
|
25
|
+
code_loader/leaploader.py,sha256=hM8-7t8rnR5hQjceZqRzLFwUJkg4zEc2jjMlTzqBkc0,30495
|
|
26
26
|
code_loader/leaploaderbase.py,sha256=-FAJUQlgDTI4QwJP8lwgwEFVOlnwCRi3-nSvPruCVGU,4587
|
|
27
27
|
code_loader/mixpanel_tracker.py,sha256=U20vQXH8G7XIVXxcpQcVEZSuIwwGnyH5RMHXWZZG8HI,4639
|
|
28
28
|
code_loader/plot_functions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -31,7 +31,7 @@ code_loader/plot_functions/visualize.py,sha256=gsBAYYkwMh7jIpJeDMPS8G4CW-pxwx6Lz
|
|
|
31
31
|
code_loader/utils.py,sha256=_j8b60pimoNAvWMRj7hEkkT6C76qES6cZoBFHpXHMxA,2698
|
|
32
32
|
code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
code_loader/visualizers/default_visualizers.py,sha256=onRnLE_TXfgLN4o52hQIOOhUcFexGlqJ3xSpQDVLuZM,2604
|
|
34
|
-
code_loader-1.0.118.
|
|
35
|
-
code_loader-1.0.118.
|
|
36
|
-
code_loader-1.0.118.
|
|
37
|
-
code_loader-1.0.118.
|
|
34
|
+
code_loader-1.0.118.dev6.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
|
|
35
|
+
code_loader-1.0.118.dev6.dist-info/METADATA,sha256=s4jaMrxmme00jJv9eoK1ZvXPXtjceTh7JY7UlMUUgQc,1095
|
|
36
|
+
code_loader-1.0.118.dev6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
37
|
+
code_loader-1.0.118.dev6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|