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

Set global_config for doctests

parent f8f048ed
...@@ -8,11 +8,16 @@ ...@@ -8,11 +8,16 @@
# All configuration values have a default; values that are commented out # All configuration values have a default; values that are commented out
# serve to show the default. # serve to show the default.
import os
import sys
import inspect import inspect
import os
import shutil import shutil
import sys
doctest_global_setup = '''
import pystencils
import numpy as np
import sympy
'''
__location__ = os.path.join(os.getcwd(), os.path.dirname( __location__ = os.path.join(os.getcwd(), os.path.dirname(
inspect.getfile(inspect.currentframe()))) inspect.getfile(inspect.currentframe())))
...@@ -222,21 +227,21 @@ htmlhelp_basename = 'pystencils_autodiff-doc' ...@@ -222,21 +227,21 @@ htmlhelp_basename = 'pystencils_autodiff-doc'
# -- Options for LaTeX output -------------------------------------------------- # -- Options for LaTeX output --------------------------------------------------
latex_elements = { latex_elements = {
# The paper size ('letterpaper' or 'a4paper'). # The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper', # 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt'). # The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt', # 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble. # Additional stuff for the LaTeX preamble.
# 'preamble': '', # 'preamble': '',
} }
# Grouping the document tree into LaTeX files. List of tuples # Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]). # (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [ latex_documents = [
('index', 'user_guide.tex', u'pystencils_autodiff Documentation', ('index', 'user_guide.tex', u'pystencils_autodiff Documentation',
u'Stephan Seitz', 'manual'), u'Stephan Seitz', 'manual'),
] ]
# The name of an image file (relative to this directory) to place at the top of # The name of an image file (relative to this directory) to place at the top of
......
...@@ -179,12 +179,10 @@ def test_tfmad_gradient_check_torch(): ...@@ -179,12 +179,10 @@ def test_tfmad_gradient_check_torch():
print('Forward output fields (to check order)') print('Forward output fields (to check order)')
print(auto_diff.forward_input_fields) print(auto_diff.forward_input_fields)
a_tensor = torch.zeros( a_tensor = torch.zeros(*a.shape, dtype=torch.float64, requires_grad=True)
*a.shape, dtype=torch.float64, requires_grad=True) b_tensor = torch.zeros(*b.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')
function = auto_diff.create_tensorflow_op(
{a: a_tensor, b: b_tensor}, backend='torch')
torch.autograd.gradcheck(function.apply, [a_tensor, b_tensor]) 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