code-loader 1.0.127__tar.gz → 1.0.129__tar.gz
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-1.0.127 → code_loader-1.0.129}/PKG-INFO +1 -1
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/inner_leap_binder/leapbinder_decorators.py +44 -13
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/plot_functions/plot_functions.py +0 -1
- {code_loader-1.0.127 → code_loader-1.0.129}/pyproject.toml +1 -1
- {code_loader-1.0.127 → code_loader-1.0.129}/LICENSE +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/README.md +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/__init__.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/contract/__init__.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/contract/datasetclasses.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/contract/enums.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/contract/exceptions.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/contract/mapping.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/contract/responsedataclasses.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/contract/visualizer_classes.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/default_losses.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/default_metrics.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/experiment_api/__init__.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/experiment_api/api.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/experiment_api/cli_config_utils.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/experiment_api/client.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/experiment_api/epoch.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/experiment_api/experiment.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/experiment_api/experiment_context.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/experiment_api/types.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/experiment_api/utils.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/experiment_api/workingspace_config_utils.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/inner_leap_binder/__init__.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/inner_leap_binder/leapbinder.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/leaploader.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/leaploaderbase.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/mixpanel_tracker.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/plot_functions/__init__.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/plot_functions/visualize.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/utils.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/visualizers/__init__.py +0 -0
- {code_loader-1.0.127 → code_loader-1.0.129}/code_loader/visualizers/default_visualizers.py +0 -0
{code_loader-1.0.127 → code_loader-1.0.129}/code_loader/inner_leap_binder/leapbinder_decorators.py
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# mypy: ignore-errors
|
|
2
2
|
import os
|
|
3
|
+
from functools import lru_cache
|
|
3
4
|
from typing import Optional, Union, Callable, List, Dict
|
|
4
5
|
|
|
5
6
|
import numpy as np
|
|
@@ -21,6 +22,7 @@ import inspect
|
|
|
21
22
|
import functools
|
|
22
23
|
|
|
23
24
|
_called_from_inside_tl_decorator = 0
|
|
25
|
+
_called_from_inside_tl_integration_test_decorator = False
|
|
24
26
|
|
|
25
27
|
|
|
26
28
|
def _add_mapping_connection(user_unique_name, connection_destinations, arg_names, name, node_mapping_type):
|
|
@@ -46,17 +48,22 @@ def integration_test():
|
|
|
46
48
|
leap_binder.integration_test_func = integration_test_function
|
|
47
49
|
|
|
48
50
|
def inner(*args, **kwargs):
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
global _called_from_inside_tl_integration_test_decorator
|
|
51
52
|
try:
|
|
52
|
-
|
|
53
|
-
integration_test_function(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
_called_from_inside_tl_integration_test_decorator = True
|
|
54
|
+
ret = integration_test_function(*args, **kwargs)
|
|
55
|
+
|
|
56
|
+
try:
|
|
57
|
+
os.environ[mapping_runtime_mode_env_var_mame] = 'True'
|
|
58
|
+
integration_test_function(None, None)
|
|
59
|
+
except Exception as e:
|
|
60
|
+
print(f'Error during integration test: Make sure to disable any non tensorleap decorators '
|
|
61
|
+
f'functions before pushing a new TL version')
|
|
62
|
+
finally:
|
|
63
|
+
if mapping_runtime_mode_env_var_mame in os.environ:
|
|
64
|
+
del os.environ[mapping_runtime_mode_env_var_mame]
|
|
57
65
|
finally:
|
|
58
|
-
|
|
59
|
-
del os.environ[mapping_runtime_mode_env_var_mame]
|
|
66
|
+
_called_from_inside_tl_integration_test_decorator = False
|
|
60
67
|
|
|
61
68
|
return inner
|
|
62
69
|
|
|
@@ -71,6 +78,7 @@ def tensorleap_load_model(prediction_types: Optional[List[PredictionTypeHandler]
|
|
|
71
78
|
class TempMapping:
|
|
72
79
|
pass
|
|
73
80
|
|
|
81
|
+
@lru_cache()
|
|
74
82
|
def inner():
|
|
75
83
|
class ModelPlaceholder:
|
|
76
84
|
def __init__(self):
|
|
@@ -85,6 +93,9 @@ def tensorleap_load_model(prediction_types: Optional[List[PredictionTypeHandler]
|
|
|
85
93
|
def run(self, output_names, input_dict):
|
|
86
94
|
return self.model.run(output_names, input_dict)
|
|
87
95
|
|
|
96
|
+
def get_inputs(self):
|
|
97
|
+
return self.model.get_inputs()
|
|
98
|
+
|
|
88
99
|
return ModelPlaceholder()
|
|
89
100
|
|
|
90
101
|
def mapping_inner():
|
|
@@ -116,11 +127,31 @@ def tensorleap_load_model(prediction_types: Optional[List[PredictionTypeHandler]
|
|
|
116
127
|
assert output_names is None
|
|
117
128
|
assert isinstance(input_dict, dict), \
|
|
118
129
|
f'Expected input_dict to be a dict, got {type(input_dict)} instead.'
|
|
119
|
-
for i, elem in enumerate(input_dict.
|
|
120
|
-
|
|
130
|
+
for i, (input_key, elem) in enumerate(input_dict.items()):
|
|
131
|
+
if isinstance(input_key, NodeMappingType):
|
|
132
|
+
elem.node_mapping.type = input_key
|
|
133
|
+
else:
|
|
134
|
+
elem.node_mapping.type = NodeMappingType[f'Input{str(i)}']
|
|
121
135
|
|
|
122
136
|
return ModelOutputPlaceholder()
|
|
123
137
|
|
|
138
|
+
def get_inputs(self):
|
|
139
|
+
class FollowIndex:
|
|
140
|
+
def __init__(self, index):
|
|
141
|
+
self.name = NodeMappingType[f'Input{str(i)}']
|
|
142
|
+
|
|
143
|
+
class FollowInputIndex:
|
|
144
|
+
def __init__(self):
|
|
145
|
+
pass
|
|
146
|
+
|
|
147
|
+
def __getitem__(self, index):
|
|
148
|
+
assert isinstance(index, int), \
|
|
149
|
+
f'Expected key to be an int, got {type(index)} instead.'
|
|
150
|
+
|
|
151
|
+
return FollowIndex(index)
|
|
152
|
+
|
|
153
|
+
return FollowInputIndex()
|
|
154
|
+
|
|
124
155
|
return ModelPlaceholder()
|
|
125
156
|
|
|
126
157
|
def final_inner():
|
|
@@ -762,7 +793,7 @@ def tensorleap_input_encoder(name: str, channel_dim=-1, model_input_index=None):
|
|
|
762
793
|
|
|
763
794
|
_validate_result(result)
|
|
764
795
|
|
|
765
|
-
if _called_from_inside_tl_decorator == 0:
|
|
796
|
+
if _called_from_inside_tl_decorator == 0 and _called_from_inside_tl_integration_test_decorator:
|
|
766
797
|
result = np.expand_dims(result, axis=0)
|
|
767
798
|
|
|
768
799
|
return result
|
|
@@ -846,7 +877,7 @@ def tensorleap_gt_encoder(name: str):
|
|
|
846
877
|
|
|
847
878
|
_validate_result(result)
|
|
848
879
|
|
|
849
|
-
if _called_from_inside_tl_decorator == 0:
|
|
880
|
+
if _called_from_inside_tl_decorator == 0 and _called_from_inside_tl_integration_test_decorator:
|
|
850
881
|
result = np.expand_dims(result, axis=0)
|
|
851
882
|
|
|
852
883
|
return result
|
|
@@ -29,7 +29,6 @@ def run_only_on_non_mapping_mode():
|
|
|
29
29
|
def decorator(func):
|
|
30
30
|
def wrapper(*args, **kwargs):
|
|
31
31
|
if os.environ.get(mapping_runtime_mode_env_var_mame):
|
|
32
|
-
print(f"Skipping {func.__name__} in mapping mode.")
|
|
33
32
|
return
|
|
34
33
|
return func(*args, **kwargs)
|
|
35
34
|
return wrapper
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{code_loader-1.0.127 → code_loader-1.0.129}/code_loader/experiment_api/experiment_context.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{code_loader-1.0.127 → code_loader-1.0.129}/code_loader/experiment_api/workingspace_config_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|