MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / _ensure_tuple_outputs

Method _ensure_tuple_outputs

monai/inferers/inferer.py:233–238  ·  view source on GitHub ↗
(self, outputs: Any)

Source from the content-addressed store, hash-verified

231 yield torch.cat(patch_batch[:idx_in_batch]), location_batch, idx_in_batch
232
233 def _ensure_tuple_outputs(self, outputs: Any) -> tuple:
234 if isinstance(outputs, dict):
235 if self.output_keys is None:
236 self.output_keys = list(outputs.keys()) # model's output keys
237 return tuple(outputs[k] for k in self.output_keys)
238 return ensure_tuple(outputs, wrap_array=True)
239
240 def _run_inference(self, network: Callable, patch: torch.Tensor, *args: Any, **kwargs: Any) -> tuple:
241 # pre-process

Callers 1

_run_inferenceMethod · 0.95

Calls 1

ensure_tupleFunction · 0.90

Tested by

no test coverage detected