Skip to content

Commit e2f6f02

Browse files
committed
output low nibble first
1 parent 2487411 commit e2f6f02

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

onnxruntime/core/providers/cpu/tensor/cast_op.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,8 @@ struct TensorCaster<Int4x2, float> {
372372
int8_t high_nibble = static_cast<int8_t>(packed) >> 4;
373373
int8_t low_nibble = static_cast<int8_t>(packed << 4) >> 4;
374374

375-
out_data[2 * i] = static_cast<float>(high_nibble);
376-
out_data[2 * i + 1] = static_cast<float>(low_nibble);
375+
out_data[2 * i] = static_cast<float>(low_nibble);
376+
out_data[2 * i + 1] = static_cast<float>(high_nibble);
377377
}
378378
}
379379
};
@@ -398,8 +398,8 @@ struct TensorCaster<UInt4x2, float> {
398398
uint8_t high_nibble = (packed >> 4) & 0x0F;
399399
uint8_t low_nibble = packed & 0x0F;
400400

401-
out_data[2 * i] = static_cast<float>(high_nibble);
402-
out_data[2 * i + 1] = static_cast<float>(low_nibble);
401+
out_data[2 * i] = static_cast<float>(low_nibble);
402+
out_data[2 * i + 1] = static_cast<float>(high_nibble);
403403
}
404404
}
405405
};

0 commit comments

Comments
 (0)