torch.has_dtype
function has_dtype(name: string): booleanCheck if a dtype is registered (built-in or custom).
Parameters
namestring- The dtype name to check
Returns
boolean– True if dtype existsExamples
torch.library.has_dtype('float32'); // true (built-in)
torch.library.has_dtype('quaternion_f32'); // true (if registered)
torch.library.has_dtype('unknown'); // false