Skip to content

Commit 6107d15

Browse files
t-visoumith
authored andcommitted
Twice differentiability of pointwise functions (pytorch#1531)
1 parent ba885a1 commit 6107d15

File tree

4 files changed

+226
-194
lines changed

4 files changed

+226
-194
lines changed

test/test_autograd.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,10 +1294,10 @@ class dont_convert(tuple):
12941294
(Floor, (), ((S, S, S),)),
12951295
(Ceil, (), ((S, S, S),)),
12961296
(Frac, (), ((S, S, S),)),
1297-
(Fmod, (1.5,), ((S, S, S),)),
1298-
(Lerp, (0.2,), ((S, S, S), (S, S, S))),
1297+
(Fmod, (), ((S, S, S), 1.5)),
1298+
(Lerp, (), ((S, S, S), (S, S, S), 0.2)),
12991299
(Rsqrt, (), (torch.rand(S, S, S) + 1e-2,)),
1300-
(Remainder, (1.5,), ((S, S, S),)),
1300+
(Remainder, (), ((S, S, S), 1.5)),
13011301
(CmaxConstant, (), ((S, S, S), 0.5)),
13021302
(CminConstant, (), ((S, S, S), 0.5)),
13031303
(Mean, (), ((S, S, S),)),
@@ -1358,9 +1358,9 @@ class dont_convert(tuple):
13581358
(Norm, (2, 1, False,), ((S, S, S),), 'keepdim_false_2_dim', [1]),
13591359
(Norm, (3, 1, False), ((S, S, S),), 'keepdim_false_3_dim', [1]),
13601360
(Addcmul, (), ((S, S), (S, S), (S, S))),
1361-
(Addcmul, (0.6,), ((S, S), (S, S), (S, S)), 'scale'),
1361+
(Addcmul, (), ((S, S), (S, S), (S, S), 0.6), 'scale'),
13621362
(Addcdiv, (), ((S, S), (S, S), torch.rand(S, S) + 5e-2)),
1363-
(Addcdiv, (0.6,), ((S, S), (S, S), torch.rand(S, S) + 5e-2), 'scale'),
1363+
(Addcdiv, (), ((S, S), (S, S), torch.rand(S, S) + 5e-2, 0.6), 'scale'),
13641364
(IndexAdd, (), ((S, S), 0, index_variable(2, S), (2, S))),
13651365
# (IndexCopy, (0,), ((S, S), index_variable(2, S), (2, S)) ),
13661366
(IndexFill, (), ((S, S), 0, index_variable(2, S), 2)),

0 commit comments

Comments
 (0)