code-loader 1.0.73__tar.gz → 1.0.75__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.

Files changed (31) hide show
  1. {code_loader-1.0.73 → code_loader-1.0.75}/PKG-INFO +1 -1
  2. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/inner_leap_binder/leapbinder_decorators.py +11 -11
  3. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/leaploader.py +2 -2
  4. {code_loader-1.0.73 → code_loader-1.0.75}/pyproject.toml +1 -1
  5. {code_loader-1.0.73 → code_loader-1.0.75}/LICENSE +0 -0
  6. {code_loader-1.0.73 → code_loader-1.0.75}/README.md +0 -0
  7. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/__init__.py +0 -0
  8. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/contract/__init__.py +0 -0
  9. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/contract/datasetclasses.py +0 -0
  10. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/contract/enums.py +0 -0
  11. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/contract/exceptions.py +0 -0
  12. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/contract/responsedataclasses.py +0 -0
  13. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/contract/visualizer_classes.py +0 -0
  14. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/default_losses.py +0 -0
  15. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/default_metrics.py +0 -0
  16. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/experiment_api/__init__.py +0 -0
  17. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/experiment_api/api.py +0 -0
  18. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/experiment_api/cli_config_utils.py +0 -0
  19. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/experiment_api/client.py +0 -0
  20. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/experiment_api/epoch.py +0 -0
  21. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/experiment_api/experiment.py +0 -0
  22. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/experiment_api/experiment_context.py +0 -0
  23. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/experiment_api/types.py +0 -0
  24. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/experiment_api/utils.py +0 -0
  25. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/experiment_api/workingspace_config_utils.py +0 -0
  26. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/inner_leap_binder/__init__.py +0 -0
  27. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/inner_leap_binder/leapbinder.py +0 -0
  28. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/leaploaderbase.py +0 -0
  29. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/utils.py +0 -0
  30. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/visualizers/__init__.py +0 -0
  31. {code_loader-1.0.73 → code_loader-1.0.75}/code_loader/visualizers/default_visualizers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code-loader
3
- Version: 1.0.73
3
+ Version: 1.0.75
4
4
  Summary:
5
5
  Home-page: https://github.com/tensorleap/code-loader
6
6
  License: MIT
@@ -8,7 +8,7 @@ import numpy.typing as npt
8
8
  from code_loader.contract.datasetclasses import CustomCallableInterfaceMultiArgs, \
9
9
  CustomMultipleReturnCallableInterfaceMultiArgs, ConfusionMatrixCallableInterfaceMultiArgs, CustomCallableInterface, \
10
10
  VisualizerCallableInterface, MetadataSectionCallableInterface, PreprocessResponse, SectionCallableInterface, \
11
- ConfusionMatrixElement
11
+ ConfusionMatrixElement, SamplePreprocessResponse
12
12
  from code_loader.contract.enums import MetricDirection, LeapDataType
13
13
  from code_loader import leap_binder
14
14
  from code_loader.contract.visualizer_classes import LeapImage, LeapImageMask, LeapTextMask, LeapText, LeapGraph, \
@@ -30,18 +30,18 @@ def tensorleap_custom_metric(name: str,
30
30
 
31
31
  def _validate_input_args(*args, **kwargs) -> None:
32
32
  for i, arg in enumerate(args):
33
- assert isinstance(arg, np.ndarray), (f'tensorleap_custom_metric validation failed: '
33
+ assert isinstance(arg, (np.ndarray, SamplePreprocessResponse)), (f'tensorleap_custom_metric validation failed: '
34
34
  f'Argument #{i} should be a numpy array. Got {type(arg)}.')
35
- if leap_binder.batch_size_to_validate:
35
+ if leap_binder.batch_size_to_validate and isinstance(arg, np.ndarray):
36
36
  assert arg.shape[0] == leap_binder.batch_size_to_validate, \
37
37
  (f'tensorleap_custom_metric validation failed: Argument #{i} '
38
38
  f'first dim should be as the batch size. Got {arg.shape[0]} '
39
39
  f'instead of {leap_binder.batch_size_to_validate}')
40
40
 
41
41
  for _arg_name, arg in kwargs.items():
42
- assert isinstance(arg, np.ndarray), (f'tensorleap_custom_metric validation failed: '
42
+ assert isinstance(arg, (np.ndarray, SamplePreprocessResponse)), (f'tensorleap_custom_metric validation failed: '
43
43
  f'Argument {_arg_name} should be a numpy array. Got {type(arg)}.')
44
- if leap_binder.batch_size_to_validate:
44
+ if leap_binder.batch_size_to_validate and isinstance(arg, np.ndarray):
45
45
  assert arg.shape[0] == leap_binder.batch_size_to_validate, \
46
46
  (f'tensorleap_custom_metric validation failed: Argument {_arg_name} '
47
47
  f'first dim should be as the batch size. Got {arg.shape[0]} '
@@ -115,17 +115,17 @@ def tensorleap_custom_visualizer(name: str, visualizer_type: LeapDataType,
115
115
 
116
116
  def _validate_input_args(*args, **kwargs):
117
117
  for i, arg in enumerate(args):
118
- assert isinstance(arg, np.ndarray), (f'tensorleap_custom_visualizer validation failed: '
118
+ assert isinstance(arg, (np.ndarray, SamplePreprocessResponse)), (f'tensorleap_custom_visualizer validation failed: '
119
119
  f'Argument #{i} should be a numpy array. Got {type(arg)}.')
120
- if leap_binder.batch_size_to_validate:
120
+ if leap_binder.batch_size_to_validate and isinstance(arg, np.ndarray):
121
121
  assert arg.shape[0] != leap_binder.batch_size_to_validate, \
122
122
  (f'tensorleap_custom_visualizer validation failed: '
123
123
  f'Argument #{i} should be without batch dimension. ')
124
124
 
125
125
  for _arg_name, arg in kwargs.items():
126
- assert isinstance(arg, np.ndarray), (f'tensorleap_custom_visualizer validation failed: '
126
+ assert isinstance(arg, (np.ndarray, SamplePreprocessResponse)), (f'tensorleap_custom_visualizer validation failed: '
127
127
  f'Argument {_arg_name} should be a numpy array. Got {type(arg)}.')
128
- if leap_binder.batch_size_to_validate:
128
+ if leap_binder.batch_size_to_validate and isinstance(arg, np.ndarray):
129
129
  assert arg.shape[0] != leap_binder.batch_size_to_validate, \
130
130
  (f'tensorleap_custom_visualizer validation failed: Argument {_arg_name} '
131
131
  f'should be without batch dimension. ')
@@ -353,10 +353,10 @@ def tensorleap_custom_loss(name: str):
353
353
 
354
354
  leap_binder.add_custom_loss(user_function, name)
355
355
 
356
- valid_types = np.ndarray
356
+ valid_types = (np.ndarray, SamplePreprocessResponse)
357
357
  try:
358
358
  import tensorflow as tf
359
- valid_types = (np.ndarray, tf.Tensor)
359
+ valid_types = (np.ndarray, SamplePreprocessResponse, tf.Tensor)
360
360
  except ImportError:
361
361
  pass
362
362
 
@@ -278,8 +278,8 @@ class LeapLoader(LeapLoaderBase):
278
278
 
279
279
  return vis_handler.function(**input_tensors_by_arg_name)
280
280
 
281
- def run_heatmap_visualizer(self, visualizer_name: str, input_tensors_by_arg_name: Dict[str, npt.NDArray[np.float32]],
282
- sample_ids: np.array, state: DataStateEnum,
281
+ def run_heatmap_visualizer(self, visualizer_name: str, sample_ids: np.array, state: DataStateEnum,
282
+ input_tensors_by_arg_name: Dict[str, npt.NDArray[np.float32]]
283
283
  ) -> Optional[npt.NDArray[np.float32]]:
284
284
  heatmap_function = self._visualizer_handler_by_name()[visualizer_name].heatmap_function
285
285
  if heatmap_function is None:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "code-loader"
3
- version = "1.0.73"
3
+ version = "1.0.75"
4
4
  description = ""
5
5
  authors = ["dorhar <doron.harnoy@tensorleap.ai>"]
6
6
  license = "MIT"
File without changes
File without changes