Skip to content
fn

dtype_name

→std::string_view
int dtype_name(Dtype dt)

Returns the canonical string name of a dtype.

This is the form used in error messages, repr(tensor) rendering, and the Python lucid.dtype wrapper's __repr__.

Parameters

dtDtype
Dtype to convert.

Returns

std::string_view

One of "bool", "int8", "int16", "int32", "int64", "float16", "float32", "float64", "complex64". The view points into a static literal — safe to store across calls.

Raises

:logic_error
The enum was extended without updating this switch.