File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -409,14 +409,13 @@ function test.DataParallelTable_noGradInput()
409409 local input = torch .Tensor (5 ):random (10 ):cuda ()
410410 local output1 = net :forward (input ):clone ()
411411 local gradOutput = output1 :clone ():uniform (- 1 , 1 )
412- local gradInput1 = net :backward (output1 , gradOutput ):clone ()
412+ local gradInput1 = net :backward (input , gradOutput ):clone ()
413413
414414 local output2 = dpt :forward (input )
415- local gradInput2 = dpt :backward (output2 , gradOutput )
416- mytester :assert ((output1 - output2 ):abs ():max (), precision ,
415+ local gradInput2 = dpt :backward (input , gradOutput )
416+ mytester :assertlt ((output1 - output2 ):abs ():max (), precision ,
417417 ' forward prop error' )
418- mytester :assert (gradInput2 :nElement () == 0 and gradInput1 :nElement () == 0 ,
419- ' backward prop error' )
418+ mytester :asserteq (gradInput2 :nElement (), gradInput1 :nElement ())
420419end
421420
422421function test .DataParallelTable_accGradParameters ()
You can’t perform that action at this time.
0 commit comments