Skip to content

Commit

Permalink
Header bug fix
Browse files Browse the repository at this point in the history
Summary: A last minute change created a compile error on the header.  This fixes the issue.

Differential Revision: D64370707
  • Loading branch information
metascroy authored and facebook-github-bot committed Oct 15, 2024
1 parent b53694a commit c8a2749
Showing 1 changed file with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,18 @@
namespace torchao::ops::linear_8bit_act_xbit_weight {

torchao::ops::PackedWeightsHeader get_packed_weights_header_universal(
int weight_nbit,
unsigned char weight_nbit,
bool has_weight_zeros,
bool has_bias,
int nr,
int kr,
int version = 1) {
TORCHAO_CHECK(
version >= 0 && version < 256, "version must be between 0 and 255");
TORCHAO_CHECK(
weight_nbit >= 1 && weight_nbit < 256,
"weight_nbit must be between 1 and 255");
unsigned short nr,
unsigned short kr,
unsigned char version = 1) {
return torchao::ops::PackedWeightsHeader(
torchao::ops::PackedWeightsFormat::linear_8bit_act_xbit_weight_universal,
{((static_cast<unsigned short>(version) << 8) |
static_cast<unsigned short>(weight_nbit)),
((static_cast<unsigned short>(has_weight_zeros) << 8) |
static_cast<unsigned short>(has_bias)),
static_cast<unsigned short>(nr),
static_cast<unsigned short>(kr),
0,
{static_cast<unsigned short>((version << 8) | weight_nbit),
static_cast<unsigned short>((has_weight_zeros << 8) | has_bias),
nr,
kr,
0,
0,
0});
Expand Down

0 comments on commit c8a2749

Please sign in to comment.