Skip to content

Commit

Permalink
Update scaled_dot_product_attention.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
p-durandin authored Dec 4, 2024
1 parent 052920b commit 137ec78
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ struct scaled_dot_product_attention_impl : multi_stage_primitive<scaled_dot_prod
}

std::vector<layout> layouts;
for (size_t i = 0; i < _kernels_data.size(); i++) {
auto dtype = from_data_type(_kernels_data[i].internalBufferDataType);
if (kernel_idx < _kernels_data.size()) {
auto dtype = from_data_type(_kernels_data[kernel_idx].internalBufferDataType);
const auto bpp = data_type_traits::size_of(dtype);
for (auto size : _kernels_data[i].internalBufferSizes) {
for (auto size : _kernels_data[kernel_idx].internalBufferSizes) {
layout inbuf_layout = {dtype, format::bfyx, // simple linear format (flattern to x channel)
{1, 1, 1, (tensor::value_type)(size / bpp)}};
layouts.push_back(inbuf_layout);
Expand Down

0 comments on commit 137ec78

Please sign in to comment.