Skip to content

Commit

Permalink
[NeoML] minor optimizations in CBaseLayer
Browse files Browse the repository at this point in the history
Signed-off-by: Kirill Golikov <kirill.golikov@abbyy.com>
  • Loading branch information
favorart committed Apr 2, 2024
1 parent 9bf0433 commit d27af04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions NeoML/include/NeoML/Dnn/Dnn.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,6 @@ class NEOML_API CBaseLayer : public virtual IObject {

virtual void OnDnnChanged( CDnn* ) {}

void SetOutputBlob(int num, CDnnBlob* blob);

// Fills with zeros the parameters that are less (but not equal) than a given threshold
virtual void FilterLayerParams( float /*threshold*/ ) {}

Expand Down
4 changes: 2 additions & 2 deletions NeoML/src/Dnn/BaseLayer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright © 2017-2020 ABBYY Production LLC
/* Copyright © 2017-2024 ABBYY
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -676,7 +676,7 @@ void CBaseLayer::transferDiffBlob( CDnnBlob* diffBlob, int outputNum )
// If an output is connected to several inputs, create a copy of the diff blob and then add it to the others
if(readyOutputDiffs[outputNum] == 0) {
if( outputDiffBlobs[outputNum] == 0 ) {
outputDiffBlobs[outputNum] = cloneBlobForDiff(diffBlob->GetDesc());
outputDiffBlobs[outputNum] = CDnnBlob::CreateBlob( MathEngine(), diffBlob->GetDesc() );
}
outputDiffBlobs[outputNum]->CopyFrom( diffBlob );
} else {
Expand Down

0 comments on commit d27af04

Please sign in to comment.