#include "tensorstore/index.h"
using tensorstore::DimensionIndex = ptrdiff_t;

Type for representing a dimension index or rank.

constexpr const DimensionIndex tensorstore::kMaxRank = 32;

Maximum supported rank.

constexpr const DynamicRank tensorstore::dynamic_rank = {};

Special rank value indicating a rank specified at run time.

constexpr bool tensorstore::IsValidRank(DimensionIndex rank);

Checks if rank is a valid rank value.

absl::Status tensorstore::ValidateRank(DimensionIndex rank);

Validates that 0 <= rank <= kMaxRank.

using tensorstore::StaticRank<Rank> =
   
 std::integral_constant<DimensionIndex, Rank>;

Template alias that evaluates to the type used for representing a static rank.

using tensorstore::StaticOrDynamicRank<Rank> =
   
 std::conditional_t<(Rank <= dynamic_rank),
                      
 DimensionIndex,
                      
 std::integral_constant<DimensionIndex, Rank>>;

Template alias that evaluates to the type used for representing a static or dynamic rank.