Skip to content

Commit

Permalink
Merge pull request tensorflow#236 from ywkim:filterwarnings
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 227751751
  • Loading branch information
tensorflower-gardener committed Jan 3, 2019
2 parents d77c122 + 05b97e8 commit 70253ba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tensorflow_probability/python/mcmc/metropolis_hastings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@

# Cause all warnings to always be triggered.
# Not having this means subsequent calls wont trigger the warning.
warnings.simplefilter('always')

warnings.filterwarnings('always',
module='tensorflow_probability.*metropolis_hastings',
append=True) # Don't override user-set filters.

MetropolisHastingsKernelResults = collections.namedtuple(
'MetropolisHastingsKernelResults',
Expand Down
4 changes: 3 additions & 1 deletion tensorflow_probability/python/mcmc/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@

# Cause all warnings to always be triggered.
# Not having this means subsequent calls wont trigger the warning.
warnings.simplefilter("always")
warnings.filterwarnings("always",
module="tensorflow_probability.*sample",
append=True) # Don't override user-set filters.


def sample_chain(
Expand Down
4 changes: 3 additions & 1 deletion tensorflow_probability/python/util/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

# Cause all warnings to always be triggered.
# Not having this means subsequent calls wont trigger the warning.
warnings.simplefilter("always")
warnings.filterwarnings("always",
module="tensorflow_probability.*variables",
append=True) # Don't override user-set filters.


def externalize_variables_as_args(fn,
Expand Down

0 comments on commit 70253ba

Please sign in to comment.