Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pycodegen
pystencils_autodiff
Commits
a7d2bf41
Commit
a7d2bf41
authored
Aug 08, 2019
by
Stephan Seitz
Browse files
Add AutoDiffOp.create_torch_op
parent
4d8ddc23
Changes
2
Hide whitespace changes
Inline
Side-by-side
docs/index.rst
View file @
a7d2bf41
===================
pystencils
_
autodiff
pystencils
-
autodiff
===================
This is the documentation of **pystencils
_
autodiff**.
This is the documentation of **pystencils
-
autodiff**.
.. include:: ../README.rst
Contents
...
...
src/pystencils_autodiff/autodiff.py
View file @
a7d2bf41
...
...
@@ -21,6 +21,11 @@ class DiffModes(str, Enum):
class
AutoDiffOp
:
"""
Class to generate code for forward and backward kernels for automatic
differentiation operators.
"""
_REPR_TEMPLATE
=
jinja2
.
Template
(
"""Forward:
{{ forward_assignments | indent(4) }}
...
...
@@ -432,6 +437,9 @@ Backward:
def
time_constant_fields
(
self
):
return
self
.
_time_constant_fields
def
create_torch_op
(
self
,
*
args
,
**
kwags
):
return
self
.
create_tensorflow_op
(
*
args
,
backend
=
'torch_native'
,
**
kwags
)
def
create_tensorflow_op
(
self
,
inputfield_tensor_dict
,
forward_loop
=
None
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment