Skip to content

Commit

Permalink
update modelwriter for rmsnorm (#5676)
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Sep 4, 2024
1 parent 204583b commit 21e54d8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tools/modelwriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
#include "layer/reorg.h"
#include "layer/requantize.h"
#include "layer/reshape.h"
#include "layer/rmsnorm.h"
#include "layer/rnn.h"
#include "layer/roialign.h"
#include "layer/roipooling.h"
Expand Down Expand Up @@ -2313,6 +2314,17 @@ int ModelWriter::save(const char* parampath, const char* binpath)
fprintf_param_value(" 2=%d", c)
fprintf_param_value(" 3=%d", permute)
}
else if (layer->type == "RMSNorm")
{
ncnn::RMSNorm* op = (ncnn::RMSNorm*)layer;
ncnn::RMSNorm* op_default = (ncnn::RMSNorm*)layer_default;

fprintf_param_value(" 0=%d", affine_size)
fprintf_param_value(" 1=%e", eps)
fprintf_param_value(" 2=%d", affine)

fwrite_weight_data(op->gamma_data, bp);
}
else if (layer->type == "RNN")
{
ncnn::RNN* op = (ncnn::RNN*)layer;
Expand Down

0 comments on commit 21e54d8

Please sign in to comment.