Skip to content

Commit

Permalink
Make AddLayer*Impl private
Browse files Browse the repository at this point in the history
  • Loading branch information
daquexian committed Nov 18, 2019
1 parent fa28ade commit e97b9db
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 8 additions & 2 deletions generate_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,14 @@ def generate_model_builder():
# A hack
params.append(('const dnn::optional<QuantInfo> &', 'output_quant_info=dnn::nullopt'))
params_str = ', '.join(map(lambda param: "{} {}".format(*param), params))
cogoutl("void AddLayer{}{}({});".format(
op['nnapi'], '' if op['builder_simple'] else 'Impl', params_str))
if op['builder_simple']:
cogoutl("void AddLayer{}({});".format(
op['nnapi'], params_str))
else:
cogoutl('private:')
cogoutl("void AddLayer{}Impl({});".format(
op['nnapi'], params_str))
cogoutl('public:')
update_code('include/dnnlibrary/ModelBuilder.h', 'ModelBuilder auto generated methods')


Expand Down
9 changes: 6 additions & 3 deletions include/dnnlibrary/ModelBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,12 @@ class ModelBuilder {
void AddLayerTANH(const std::string &input, const std::string &output);
void AddLayerFLOOR(const std::string &input, const std::string &output);
void AddLayerLOGISTIC(const std::string &input, const std::string &output);

private:
void AddLayerPRELUImpl(const std::string &input, const std::string &alpha,
const std::string &output);

public:
void AddLayerPOW(const std::string &input, const std::string &exp,
const std::string &output);
void AddLayerNEG(const std::string &input, const std::string &output);
Expand All @@ -190,9 +194,8 @@ class ModelBuilder {
const std::string &output);
void AddLayerLOG(const std::string &input, const std::string &output);
// ModelBuilder auto generated methods end
void AddLayerPRELU(const std::string &input,
const std::string &alpha,
const std::string &output);
void AddLayerPRELU(const std::string &input, const std::string &alpha,
const std::string &output);
Index AddTensorFromPersistentBuffer(
const std::string &name, const void *buffer,
const android::nn::wrapper::OperandType &operand_type);
Expand Down

0 comments on commit e97b9db

Please sign in to comment.