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
75f1a1c0
Commit
75f1a1c0
authored
Dec 16, 2019
by
Stephan Seitz
Browse files
Fix README.rst/index.rst
parent
1666f0b9
Pipeline
#20548
failed with stage
in 6 minutes
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.rst
View file @
75f1a1c0
...
...
@@ -92,18 +92,13 @@ You can also use the class `AutoDiffOp` to obtain both the assignments (if you a
op = AutoDiffOp(forward_assignments)
backward_assignments = op.backward_assignments
x_tensor = pystencils.autodiff.tf_variable_from_field(x)
y_tensor = pystencils.autodiff.tf_variable_from_field(y)
tensorflow_op = op.create_tensorflow_op({x: x_tensor, y: y_tensor}, backend='tensorflow')
tensorflow_op = op.create_tensorflow_op(backend='tensorflow_native')
... or Torch:
.. code-block:: python
x_tensor = pystencils.autodiff.torch_tensor_from_field(x, cuda=False, requires_grad=True)
y_tensor = pystencils.autodiff.torch_tensor_from_field(y, cuda=False, requires_grad=True)
z_tensor = op.create_tensorflow_op({x: x_tensor, y: y_tensor}, backend='torch')
torch_op = op.create_tensorflow_op({x: x_tensor, y: y_tensor}, backend='torch_native')
Test Report and Coverage
------------------------
...
...
docs/index.rst
View file @
75f1a1c0
...
...
@@ -84,18 +84,20 @@ You can also use the class :class:`pystencils_autodiff.AutoDiffOp` to obtain bot
op = AutoDiffOp(forward_assignments)
backward_assignments = op.backward_assignments
x_tensor = pystencils.autodiff.tf_variable_from_field(x)
y_tensor = pystencils.autodiff.tf_variable_from_field(y)
tensorflow_op = op.create_tensorflow_op({x: x_tensor, y: y_tensor}, backend='tensorflow')
tensorflow_op = op.create_tensorflow_op(backend='tensorflow_native')
.. testoutput::
:hide:
:options: -ELLIPSIS, +NORMALIZE_WHITESPACE
Compiling Tensorflow module...
Linking Tensorflow module...
... or Torch:
.. testcode::
x_tensor = pystencils.autodiff.torch_tensor_from_field(x, cuda=False, requires_grad=True)
y_tensor = pystencils.autodiff.torch_tensor_from_field(y, cuda=False, requires_grad=True)
z_tensor = op.create_tensorflow_op({x: x_tensor, y: y_tensor}, backend='torch')
torch_op = op.create_tensorflow_op(backend='torch_native')
Contents
...
...
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