#include "tensorstore/cast.h"
Result<Spec>
tensorstore::Cast(const Specbase_specDataType target_dtype);

Returns a view of a Spec with a converted data type.

If base_spec.dtype() is known, the conversion is validated.

Parameters:
const Spec &base_spec

The Spec to convert.

DataType target_dtype

Target data type.

Error absl::StatusCode::kInvalidArgument:

if the conversion is not supported.