File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
keras/src/trainers/data_adapters Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -240,12 +240,11 @@ def test_class_weight(self):
240
240
for index , batch in enumerate (gen ):
241
241
# Batch is a tuple of (x, y, class_weight)
242
242
self .assertLen (batch , 3 )
243
+ batch = [backend .convert_to_numpy (x ) for x in batch ]
243
244
# Let's verify the data and class weights match for each element
244
245
# of the batch (2 elements in each batch)
245
246
for sub_elem in range (2 ):
246
- self .assertTrue (
247
- np .array_equal (batch [0 ][sub_elem ], x [index * 2 + sub_elem ])
248
- )
247
+ self .assertAllEqual (batch [0 ][sub_elem ], x [index * 2 + sub_elem ])
249
248
self .assertEqual (batch [1 ][sub_elem ], y [index * 2 + sub_elem ])
250
249
class_key = np .int32 (batch [1 ][sub_elem ])
251
250
self .assertEqual (batch [2 ][sub_elem ], class_w [class_key ])
You can’t perform that action at this time.
0 commit comments