We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98db28a commit 4f9d17aCopy full SHA for 4f9d17a
test/legacy_test/test_label_smooth_op.py
@@ -173,6 +173,18 @@ def setUp(self):
173
)
174
175
176
+class TestLabelSmoothOp_ZeroSize(TestLabelSmoothOp):
177
+ def config(self):
178
+ self.op_type = "label_smooth"
179
+ self.python_api = paddle.nn.functional.label_smooth
180
+ self.init_dtype()
181
+ self.epsilon = 0.1
182
+ batch_size, self.label_dim = 0, 12
183
+ self.label = np.zeros((batch_size, self.label_dim)).astype(self.dtype)
184
+ nonzero_index = np.random.randint(self.label_dim, size=(batch_size))
185
+ self.label[np.arange(batch_size), nonzero_index] = 1
186
+
187
188
if __name__ == '__main__':
189
paddle.enable_static()
190
unittest.main()
0 commit comments