Skip to content

Commit 3d891bf

Browse files
authored
Don't create MultipleException if f1 and f2 are the same
1 parent 6969d84 commit 3d891bf

File tree

1 file changed

+4
-3
lines changed
  • plugins-INDArrayLayers/src/main/scala-2.11/com/thoughtworks/deeplearning/plugins

1 file changed

+4
-3
lines changed

plugins-INDArrayLayers/src/main/scala-2.11/com/thoughtworks/deeplearning/plugins/INDArrayLayers.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ trait INDArrayLayers extends DoubleLayers with DoubleLiterals with ImplicitsSing
111111
case (aSize, bSize) if aSize == bSize => aSize
112112
case _ =>
113113
throw new IllegalArgumentException(
114-
raw"Failed to automatically broadcast between shape [${shape1.mkString(",")] and [${shape2.mkString(",")}]}"
114+
raw"Failed to automatically broadcast between shape [${shape1.mkString(",")}] and [${shape2.mkString(",")}]}"
115115
)
116116
}
117117
}
@@ -134,12 +134,13 @@ trait INDArrayLayers extends DoubleLayers with DoubleLiterals with ImplicitsSing
134134
case MultipleException(exceptionSet1) =>
135135
f2 match {
136136
case MultipleException(exceptionSet2) => MultipleException(exceptionSet1 ++ exceptionSet2)
137-
case _: Throwable => MultipleException(exceptionSet1 + f2)
137+
case e: Throwable => MultipleException(exceptionSet1 + e)
138138
}
139139
case _: Throwable =>
140140
f2 match {
141141
case MultipleException(exceptionSet2) => MultipleException(exceptionSet2 + f1)
142-
case _: Throwable => MultipleException(Set(f1, f2))
142+
case `f1` => f1
143+
case e: Throwable => MultipleException(Set(f1, e))
143144
}
144145
}
145146
})

0 commit comments

Comments
 (0)