@@ -162,31 +162,31 @@ class Test_sample_batch:
162162 def test_loader (self , music_streaming_data ):
163163 loader = Loader (music_streaming_data , batch_size = 2 )
164164
165- features , targets = sample_batch (loader )
165+ batch = sample_batch (loader )
166166
167- assert isinstance (features , dict )
168- assert len (list (features .keys ())) == 12
169- for key , val in features .items ():
167+ assert isinstance (batch . features , dict )
168+ assert len (list (batch . features .keys ())) == 12
169+ for key , val in batch . features .items ():
170170 if not key .endswith ("__values" ) and not key .endswith ("__offsets" ):
171171 assert val .shape [0 ] == 2
172172
173- assert isinstance (targets , dict )
174- assert list (targets .keys ()) == ["click" , "play_percentage" , "like" ]
175- for val in targets .values ():
173+ assert isinstance (batch . targets , dict )
174+ assert list (batch . targets .keys ()) == ["click" , "play_percentage" , "like" ]
175+ for val in batch . targets .values ():
176176 assert val .shape [0 ] == 2
177177
178178 def test_dataset (self , music_streaming_data ):
179- features , targets = sample_batch (music_streaming_data , batch_size = 2 )
179+ batch = sample_batch (music_streaming_data , batch_size = 2 )
180180
181- assert isinstance (features , dict )
182- assert len (list (features .keys ())) == 12
183- for key , val in features .items ():
181+ assert isinstance (batch . features , dict )
182+ assert len (list (batch . features .keys ())) == 12
183+ for key , val in batch . features .items ():
184184 if not key .endswith ("__values" ) and not key .endswith ("__offsets" ):
185185 assert val .shape [0 ] == 2
186186
187- assert isinstance (targets , dict )
188- assert list (targets .keys ()) == ["click" , "play_percentage" , "like" ]
189- for val in targets .values ():
187+ assert isinstance (batch . targets , dict )
188+ assert list (batch . targets .keys ()) == ["click" , "play_percentage" , "like" ]
189+ for val in batch . targets .values ():
190190 assert val .shape [0 ] == 2
191191
192192
0 commit comments