Only fuse when output count of add is 1

This commit is contained in:
Yufeng Li 2020-01-21 15:34:16 -08:00 committed by Ryan Hill
parent 5ecabe1b15
commit 1a5a25331d

View file

@ -25,7 +25,8 @@ static bool IsSupportedDataType(const Node& node) {
static bool CheckFirstAdd(Node& add, ProviderType providertype) {
if (providertype != add.GetExecutionProviderType() ||
!IsSupportedDataType(add)) {
!IsSupportedDataType(add) ||
add.GetOutputEdgesCount() != 1) {
return false;
}
@ -58,7 +59,8 @@ static bool CheckFirstAdd(Node& add, ProviderType providertype) {
// The 2nd input should be a 1D constant value
static bool CheckSecondAdd(Node& add, ProviderType providertype) {
if (providertype != add.GetExecutionProviderType() ||
!IsSupportedDataType(add)) {
!IsSupportedDataType(add) ||
add.GetOutputEdgesCount() != 1) {
return false;
}