Validate a dimension index for a given tensor rank Returns the normalized dimension or a DimensionError
type Valid1 = ValidateDim<-1, [2, 3, 4]> // 2 (valid negative index)type Valid2 = ValidateDim<1, [2, 3, 4]> // 1 (valid positive index)type Invalid1 = ValidateDim<-5, [2, 3, 4]> // DimensionError (out of bounds)type Invalid2 = ValidateDim<3, [2, 3, 4]> // DimensionError (out of bounds) Copy
type Valid1 = ValidateDim<-1, [2, 3, 4]> // 2 (valid negative index)type Valid2 = ValidateDim<1, [2, 3, 4]> // 1 (valid positive index)type Invalid1 = ValidateDim<-5, [2, 3, 4]> // DimensionError (out of bounds)type Invalid2 = ValidateDim<3, [2, 3, 4]> // DimensionError (out of bounds)
Validate a dimension index for a given tensor rank Returns the normalized dimension or a DimensionError