Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tools/autograd/load_derivatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ def saved_variables(formula, args):
'suffix': lambda m: '_argsize_{}'.format(*m.groups()),
'type': 'int64_t',
}),
# replace self.numel() with self_numel
(r'{}.numel\(\)', {
'suffix': '_numel',
'type': 'int64_t',
}),
# replace to_arg_sizes(self, 2) with self_argsizes_2
(r'to_arg_sizes\({}, (\w+)\)', {
'suffix': lambda m: '_sizes_{}'.format(*m.groups()),
Expand Down