Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backends/vulkan/runtime/api/containers/Tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ std::vector<int64_t> calculate_dim_order(
return {0};
}
std::vector<int64_t> dim_order(ndim);
int64_t last_dim = ndim - 1 - packed_dim;
// Explicitly convert ndim to signed to prevent underflow
int64_t last_dim = int64_t(ndim) - 1 - packed_dim;

int64_t cur_dim = 0;
for (int d = 0; d < ndim; ++d) {
Expand Down
Loading