Skip to content

Commit

Permalink
Replace assert with fatal in Shape::get_normalized_index (#12346)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayerofieiev-tt authored Sep 6, 2024
1 parent ea957ac commit 81f9fae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ttnn/cpp/ttnn/tensor/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Padding::Padding(const std::vector<PadDimension>& pad_dimensions, PadValue pad_v
const uint32_t Padding::get_normalized_index(std::int64_t index) const {
std::int64_t rank = static_cast<std::int64_t>(this->rank_);
std::uint64_t normalized_index = index >= 0 ? index : rank + index;
TT_ASSERT(
TT_FATAL(
normalized_index >= 0 and normalized_index < rank,
fmt::format(
"Index is out of bounds for the rank, should be between 0 and {} however is {}",
Expand Down Expand Up @@ -164,7 +164,7 @@ const Shape Shape::without_padding() const {
const uint32_t Shape::get_normalized_index(std::int64_t index) const {
std::int64_t rank = static_cast<std::int64_t>(this->rank_);
std::uint64_t normalized_index = index >= 0 ? index : rank + index;
TT_ASSERT(
TT_FATAL(
normalized_index >= 0 and normalized_index < rank,
fmt::format(
"Index is out of bounds for the rank, should be between 0 and {} however is {}",
Expand Down

0 comments on commit 81f9fae

Please sign in to comment.