-
#include "tensorstore/data_type.h"
- DataType tensorstore::GetDataType(std::string_view id);
Returns the
DataType
withDataType::name
equal toid
.If
id
does not specify a supported data type name, returns the invalid data type ofDataType()
.Example:
EXPECT_EQ(dtype_v<int32_t>, GetDataType("int32")); EXPECT_EQ(dtype_v<float>, GetDataType("float32"));