Skip to content

Commit fe04817

Browse files
committed
Return dict unchanged when no keys match in RandGridDistortiond
1 parent 517a713 commit fe04817

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

monai/transforms/spatial/dictionary.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,8 +2311,7 @@ def __call__(self, data: Mapping[Hashable, torch.Tensor]) -> dict[Hashable, torc
23112311

23122312
first_key: Hashable = self.first_key(d)
23132313
if first_key == ():
2314-
out = convert_to_tensor(d, track_meta=get_track_meta())
2315-
return out
2314+
return d
23162315
if isinstance(d[first_key], MetaTensor) and d[first_key].pending_operations: # type: ignore
23172316
warnings.warn(f"data['{first_key}'] has pending operations, transform may return incorrect results.")
23182317
self.rand_grid_distortion.randomize(d[first_key].shape[1:])

0 commit comments

Comments
 (0)