Skip to content
Merged
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
4 changes: 2 additions & 2 deletions mlx/backend/metal/kernels/layer_norm.metal
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ template <typename T, int N_READS = 8>

// Compute some variables for reading writing etc
const bool safe = lid * N_READS + N_READS <= axis_size;
const int n = axis_size - lid * N_READS;
const int n = max(int(axis_size) - int(lid * N_READS), 0);

// Read the inputs
if (safe) {
Expand Down Expand Up @@ -235,7 +235,7 @@ template <typename T, int N_READS = 8>

// Compute some variables for reading writing etc
const bool safe = lid * N_READS + N_READS <= axis_size;
const int n = axis_size - lid * N_READS;
const int n = max(int(axis_size) - int(lid * N_READS), 0);

// Read the inputs
if (safe) {
Expand Down
Loading