code-loader 1.0.22__tar.gz → 1.0.23__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code-loader
3
- Version: 1.0.22
3
+ Version: 1.0.23
4
4
  Summary:
5
5
  Home-page: https://github.com/tensorleap/code-loader
6
6
  License: MIT
@@ -122,6 +122,7 @@ class MetadataHandler:
122
122
  class PredictionTypeHandler:
123
123
  name: str
124
124
  labels: List[str]
125
+ channel_dim: int
125
126
 
126
127
 
127
128
  @dataclass
@@ -62,6 +62,7 @@ class CustomLayerInstance:
62
62
  class PredictionTypeInstance:
63
63
  name: str
64
64
  labels: List[str]
65
+ channel_dim: int
65
66
 
66
67
 
67
68
  @dataclass
@@ -107,8 +107,8 @@ class LeapBinder:
107
107
  arg_names = inspect.getfullargspec(function)[0]
108
108
  self.setup_container.metrics.append(MetricHandler(name, function, arg_names))
109
109
 
110
- def add_prediction(self, name: str, labels: List[str]) -> None:
111
- self.setup_container.prediction_types.append(PredictionTypeHandler(name, labels))
110
+ def add_prediction(self, name: str, labels: List[str], channel_dim=-1) -> None:
111
+ self.setup_container.prediction_types.append(PredictionTypeHandler(name, labels, channel_dim))
112
112
 
113
113
  def set_ground_truth(self, function: SectionCallableInterface, name: str) -> None:
114
114
  function = to_numpy_return_wrapper(function)
@@ -119,7 +119,11 @@ class LeapBinder:
119
119
  def set_metadata(self, function: MetadataSectionCallableInterface, name: str) -> None:
120
120
  self.setup_container.metadata.append(MetadataHandler(name, function))
121
121
 
122
- def set_custom_layer(self, custom_layer: Type[Any], name: str) -> None:
122
+ def set_custom_layer(self, custom_layer: Type[Any], name: str, inspect_layer: bool = False,
123
+ kernel_index: Optional[int] = None) -> None:
124
+ if inspect_layer and kernel_index is not None:
125
+ custom_layer.kernel_index = kernel_index
126
+
123
127
  init_args = inspect.getfullargspec(custom_layer.__init__)[0][1:]
124
128
  call_args = inspect.getfullargspec(custom_layer.call)[0][1:]
125
129
  self.setup_container.custom_layers[name] = CustomLayerHandler(name, custom_layer, init_args, call_args)
@@ -256,7 +256,8 @@ class LeapLoader:
256
256
 
257
257
  prediction_types = []
258
258
  for prediction_type in setup.prediction_types:
259
- pred_type_inst = PredictionTypeInstance(prediction_type.name, prediction_type.labels)
259
+ pred_type_inst = PredictionTypeInstance(prediction_type.name, prediction_type.labels,
260
+ prediction_type.channel_dim)
260
261
  prediction_types.append(pred_type_inst)
261
262
 
262
263
  metrics = []
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "code-loader"
3
- version = "1.0.22"
3
+ version = "1.0.23"
4
4
  description = ""
5
5
  authors = ["dorhar <doron.harnoy@tensorleap.ai>"]
6
6
  license = "MIT"
File without changes
File without changes