torchoutil.extras.numpy.scan_info module¶
- class InvalidTorchDType(
- *args,
- **kwargs,
Bases:
objectDefault return type for torch_dtype when an invalid data is passed as argument of scan_torch_dtype function. (like str for example)
- class ShapeDTypeInfo(
- *args,
- **kwds,
Bases:
Generic[T_Invalid,T_EmptyTorch,T_EmptyNp]- torch_dtype: dtype | T_Invalid | T_EmptyTorch¶
- merge_torch_dtypes(
- dtypes: Iterable[dtype | T_Invalid | T_EmptyNp],
- *,
- invalid: T_Invalid = InvalidTorchDType(),
- empty: T_EmptyNp | None = None,
- numpy_dtype_to_torch_dtype(
- dtype: dtype,
- *,
- invalid: T_Invalid = InvalidTorchDType(),
- scan_shape_dtypes(
- x: Any,
- *,
- accept_heterogeneous_shape: bool = False,
- empty_torch: T_EmptyTorch | None = None,
- empty_np: T_EmptyNp = dtype('V'),
Returns the shape and the hdf_dtype for an input.