Skip to content

Commit 9aa8f75

Browse files
committed
Fix sparse_categorical_crossentropy.
1 parent 52b513d commit 9aa8f75

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/TensorFlowNET.Keras/BackendImpl.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,8 @@ public Tensor sparse_categorical_crossentropy(Tensor target, Tensor output, bool
307307
var update_shape = target_rank > -1 && output_rank > -1 && target_rank != output_rank - 1;
308308
if (update_shape)
309309
{
310-
/*var target = flatten(target);
311-
output = tf.reshape(output, [-1, output_shape[-1]]);*/
312-
throw new NotImplementedException("");
310+
target = tf.reshape(target, -1);
311+
output = tf.reshape(output, (-1, output.shape[-1]));
313312
}
314313

315314
if (ignore_class.HasValue)

test/TensorFlowNET.Keras.UnitTest/MultiThreadsTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace TensorFlowNET.Keras.UnitTest
1010
{
11-
[TestClass, Ignore]
11+
[TestClass]
1212
public class MultiThreads
1313
{
1414
[TestMethod]

0 commit comments

Comments
 (0)