Skip to content
Snippets Groups Projects
Commit f13da939 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Attach code to operation generated by torch_native

parent 543efa95
Branches
Tags
No related merge requests found
Pipeline #17105 failed with stage
in 2 minutes and 4 seconds
...@@ -141,7 +141,7 @@ pygments_style = 'sphinx' ...@@ -141,7 +141,7 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
html_theme = 'alabaster' html_theme = 'alabaster'
# html_theme = 'sphinx_rtd_theme' # official readthedocs theme used also by Martin # html_theme = 'sphinx_rtd_theme' #official readthedocs theme used also by Martin
# Theme options are theme-specific and customize the look and feel of a theme # Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the # further. For a list of options available for each theme, see the
......
...@@ -122,6 +122,7 @@ def generate_torch(destination_folder, ...@@ -122,6 +122,7 @@ def generate_torch(destination_folder,
from torch.utils.cpp_extension import load from torch.utils.cpp_extension import load
compiled_operation = load(operation_string, required_files, verbose=True, compiled_operation = load(operation_string, required_files, verbose=True,
extra_cuda_cflags=[] if is_cuda else []) extra_cuda_cflags=[] if is_cuda else [])
compiled_operation.code = output
return compiled_operation return compiled_operation
...@@ -163,6 +164,7 @@ def create_autograd_function(autodiff_obj, inputfield_to_tensor_dict, forward_lo ...@@ -163,6 +164,7 @@ def create_autograd_function(autodiff_obj, inputfield_to_tensor_dict, forward_lo
cls.saved = None cls.saved = None
cls.forward = forward cls.forward = forward
cls.backward = backward cls.backward = backward
cls.code = compiled_operation.code
return cls() return cls()
else: else:
op = pystencils_autodiff.backends._pytorch.create_autograd_function(autodiff_obj, op = pystencils_autodiff.backends._pytorch.create_autograd_function(autodiff_obj,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment