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
87a4ad70
Commit
87a4ad70
authored
Aug 08, 2019
by
Stephan Seitz
Browse files
Set global_config for doctests
parent
f8f048ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
docs/conf.py
View file @
87a4ad70
...
...
@@ -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,21 +227,21 @@ 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
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents
=
[
(
'index'
,
'user_guide.tex'
,
u
'pystencils_autodiff Documentation'
,
u
'Stephan Seitz'
,
'manual'
),
(
'index'
,
'user_guide.tex'
,
u
'pystencils_autodiff Documentation'
,
u
'Stephan Seitz'
,
'manual'
),
]
# The name of an image file (relative to this directory) to place at the top of
...
...
tests/test_tfmad.py
View file @
87a4ad70
...
...
@@ -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
])
...
...
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