def test_Dropout4D_double (self): np_a = np.reshape(self.np_double_a, (2,2,2,3)) dc_a = dc.reshape(self.dc_double_a, (2,2,2,3)) npr = temp_dropout(np_a,self.ratio) dcr = dc.dropout(dc_a,self.ratio) np.testing.assert_allclose(npr.flatten(), np.array(dcr.data()).astype(np.float32), rtol=1e-3, atol=1e-3)
def test_Dropout1D_double (self): npr = temp_dropout(self.np_double_a,self.ratio) dcr = dc.dropout(self.dc_double_a,self.ratio) np.testing.assert_allclose(npr, np.array(dcr.data()).astype(np.float64), rtol=1e-3, atol=1e-3)