diff --git a/tensorflow_probability/python/mcmc/hmc.py b/tensorflow_probability/python/mcmc/hmc.py index be18bd614b..0de152454b 100644 --- a/tensorflow_probability/python/mcmc/hmc.py +++ b/tensorflow_probability/python/mcmc/hmc.py @@ -134,7 +134,7 @@ def step_size_simple_update_fn(step_size_var, kernel_results): tf.log(target_rate), log_mean_accept_ratio.dtype), -decrement_multiplier / (1. + decrement_multiplier), increment_multiplier) - + a = True def build_assign_op(): if mcmc_util.is_list_like(step_size_var): return [ diff --git a/tensorflow_probability/python/mcmc/hmc_test.py b/tensorflow_probability/python/mcmc/hmc_test.py index d1eba9ef8e..61dfc57c55 100644 --- a/tensorflow_probability/python/mcmc/hmc_test.py +++ b/tensorflow_probability/python/mcmc/hmc_test.py @@ -40,6 +40,7 @@ def run_in_graph_mode_only(__unused__=None, config=None, use_gpu=True): # pylint: disable=invalid-name,unused-argument """Execute the decorated test in graph mode only.""" assert not __unused__, 'Add () after run_in_graph_mode_only.' + b = False def decorator(f): def decorated(self, **kwargs): with context.graph_mode(): diff --git a/testing/oss_lints.sh b/testing/oss_lints.sh index 364bb9ca0c..afc9dc9512 100755 --- a/testing/oss_lints.sh +++ b/testing/oss_lints.sh @@ -28,18 +28,20 @@ if [[ ${SHARD} != 0 ]]; then fi get_changed_py_files() { - # grep --quiet forces exit status 0 even if no matches are found + # Need to fetch the base branch in case it is not master. + git remote set-branches --add origin ${TRAVIS_BRANCH} + git fetch --depth=20 --quiet git diff \ --name-only \ - --diff-filter=AM ${TRAVIS_BRANCH}...HEAD \ - | grep --quiet '^tensorflow_probability.*\.py$' + --diff-filter=AM origin/${TRAVIS_BRANCH}...HEAD \ + | grep '^tensorflow_probability.*\.py$' || true } # Run lints on added/changed python files. changed_py_files=$(get_changed_py_files) if [[ -n "${changed_py_files}" ]]; then echo "Running pylint on ${changed_py_files}" - pylint -j2 --rcfile=testing/pylintrc ${changed_py_files}) + pylint -j2 --rcfile=testing/pylintrc ${changed_py_files} else echo "No files to lint." fi diff --git a/testing/oss_tests.sh b/testing/oss_tests.sh index c3df3591dd..e7f7c1efe1 100755 --- a/testing/oss_tests.sh +++ b/testing/oss_tests.sh @@ -40,8 +40,11 @@ shard_tests=$(bazel query 'tests(//tensorflow_probability/...)' | # (short, moderate, long or eternal) # --test_tag_filters -- skip tests whose 'tags' arg (if present) includes any # of the comma-separated entries +# --action_env -- specify environment vars to pass through to action +# environment. (We need these in order to run inside a virtualenv.) +# See https://github.com/bazelbuild/bazel/issues/6648 and b/121259040. echo "${shard_tests}" | xargs bazel test --copt=-O3 --copt=-march=native \ - --noincompatible_strict_action_env \ --test_tag_filters=-gpu,-requires-gpu-sm35 \ --test_timeout 300,450,1200,3600 --build_tests_only \ + --action_env=PATH --action_env=LD_LIBRARY_PATH \ --test_output=errors