Commit 87a4ad70 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Set global_config for doctests

parent f8f048ed
......@@ -8,11 +8,16 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
import sys
import inspect
import os
import shutil
import sys
doctest_global_setup = '''
import pystencils
import numpy as np
import sympy
'''
__location__ = os.path.join(os.getcwd(), os.path.dirname(
inspect.getfile(inspect.currentframe())))
......@@ -222,14 +227,14 @@ htmlhelp_basename = 'pystencils_autodiff-doc'
# -- Options for LaTeX output --------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
......
......@@ -179,12 +179,10 @@ def test_tfmad_gradient_check_torch():
print('Forward output fields (to check order)')
print(auto_diff.forward_input_fields)
a_tensor = torch.zeros(
*a.shape, dtype=torch.float64, requires_grad=True)
b_tensor = torch.zeros(
*b.shape, dtype=torch.float64, requires_grad=True)
function = auto_diff.create_tensorflow_op(
{a: a_tensor, b: b_tensor}, backend='torch')
a_tensor = torch.zeros(*a.shape, dtype=torch.float64, requires_grad=True)
b_tensor = torch.zeros(*b.shape, dtype=torch.float64, requires_grad=True)
function = auto_diff.create_tensorflow_op({a: a_tensor, b: b_tensor}, backend='torch')
torch.autograd.gradcheck(function.apply, [a_tensor, b_tensor])
......
Markdown is supported
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