Skip to content

Commit cbbc7a4

Browse files
Fix meta_data handling in MonaiBundleInferenceOperator to ensure it defaults to an empty dict
Signed-off-by: Simone Bendazzoli <[email protected]>
1 parent fbb8c61 commit cbbc7a4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

monai/deploy/operators/monai_bundle_inference_operator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ def compute(self, op_input, op_output, context):
577577
# value: NdarrayOrTensor # MyPy complaints
578578
value, meta_data = self._receive_input(name, op_input, context)
579579
value = convert_to_dst_type(value, dst=value)[0]
580+
meta_data = meta_data or {}
580581
if not isinstance(meta_data, dict):
581582
raise ValueError("`meta_data` must be a dict.")
582583
value = MetaTensor.ensure_torch_and_prune_meta(value, meta_data)

0 commit comments

Comments
 (0)