torch.DTypeInfo
export interface DTypeInfo {
/** The dtype name */
readonly name: string;
/** Number of components (1 for scalars, 2 for complex, 4 for quaternion, etc.) */
readonly components: number;
/** The underlying storage dtype for each component */
readonly componentType: DType;
/** Memory layout for multi-component types */
readonly layout: 'interleaved' | 'planar';
/** Whether this is a built-in dtype */
readonly isBuiltin: boolean;
/** Component names if defined (e.g., ['w', 'x', 'y', 'z'] for quaternions) */
readonly componentNames?: readonly string[];
/** Whether .view() can expose underlying components */
readonly allowComponentView?: boolean;
}- readonly
name(string) - – The dtype name
- readonly
components(number) - – Number of components (1 for scalars, 2 for complex, 4 for quaternion, etc.)
- readonly
componentType(DType) - – The underlying storage dtype for each component
- readonly
layout('interleaved' | 'planar') - – Memory layout for multi-component types
- readonly
isBuiltin(boolean) - – Whether this is a built-in dtype
- readonly
componentNames(readonly string[])optional - – Component names if defined (e.g., ['w', 'x', 'y', 'z'] for quaternions)
- readonly
allowComponentView(boolean)optional - – Whether .view() can expose underlying components
Information about a registered dtype.