Skip to content

Commit

Permalink
Source change (#1023)
Browse files Browse the repository at this point in the history
* fixed hierarchical clusterization with ward (#998)

Signed-off-by: Daniyal Aliev <daniial.aliev@abbyy.com>
Co-authored-by: Valeriy Fedyunin <valery.fedyunin@abbyy.com>

* master commit

Signed-off-by: daniyalaliev <daniial.aliev@abbyy.com>

* safer source set

Signed-off-by: daniyalaliev <daniial.aliev@abbyy.com>

* kirill's remarks

Signed-off-by: daniyalaliev <daniial.aliev@abbyy.com>

---------

Signed-off-by: Daniyal Aliev <daniial.aliev@abbyy.com>
Signed-off-by: daniyalaliev <daniial.aliev@abbyy.com>
Co-authored-by: Valeriy Fedyunin <valery.fedyunin@abbyy.com>
Co-authored-by: daniyalaliev <daniial.aliev@abbyy.com>
  • Loading branch information
3 people committed Jan 18, 2024
1 parent bd6151b commit 6b6f4a6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions NeoML/src/Dnn/Layers/SourceLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ namespace NeoML {

void CSourceLayer::SetBlob( CDnnBlob* _blob )
{
if( _blob == blob.Ptr() ) {
return;
}

bool sameBlob = _blob == blob.Ptr();
blob = _blob;

if( !outputDescs.IsEmpty() ) {
Expand All @@ -34,17 +31,20 @@ void CSourceLayer::SetBlob( CDnnBlob* _blob )
{
outputDescs[0] = blob->GetDesc();
ForceReshape();
} else {
sameBlob = false;
}
}

if( !outputBlobs.IsEmpty() ) {
if( !outputBlobs.IsEmpty() && !sameBlob ) {
outputBlobs[0] = 0;
}
}

void CSourceLayer::Reshape()
{
CheckOutputs();
CheckLayerArchitecture( GetInputCount() == 0, "layer must not have inputs" );
CheckLayerArchitecture( GetOutputCount() == 1, "Source layer has more than 1 output" );
CheckLayerArchitecture( blob.Ptr() != 0, "Source layer has null data blob" );
outputDescs[0] = blob->GetDesc();
Expand Down

0 comments on commit 6b6f4a6

Please sign in to comment.