Skip to content

min max function bug in safe_dtype_range #5705

@KumoLiu

Description

@KumoLiu
Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/site-packages/parameterized/parameterized.py", line 533, in standalone_func
    return func(*(a + p.args), **p.kwargs)
  File "tests/test_safe_dtype_range.py", line 59, in test_safe_dtype_range
    result = safe_dtype_range(in_image, out_dtype)
  File "/workspace/Code/MONAI/monai/utils/type_conversion.py", line 446, in safe_dtype_range
    return _safe_dtype_range(data, dtype)
  File "/workspace/Code/MONAI/monai/utils/type_conversion.py", line 430, in _safe_dtype_range
    data_bound = (min(data), max(data))
  File "/workspace/Code/MONAI/monai/data/meta_tensor.py", line 268, in __torch_function__
    ret = super().__torch_function__(func, types, args, kwargs)
  File "/opt/conda/lib/python3.8/site-packages/torch/_tensor.py", line 1265, in __torch_function__
    ret = func(*args, **kwargs)
RuntimeError: Boolean value of Tensor with more than one value is ambiguous

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions