diff options
author | 2017-07-19 15:04:52 -0700 | |
---|---|---|
committer | 2017-07-19 15:12:25 -0700 | |
commit | 9cc871e81c04ed11829c3364546b4500742140eb (patch) | |
tree | 15c55ff29356bddd5a4f252630a9dffc8ac43c4c /tensorflow/contrib | |
parent | 1fefe92f47ff4149428409847592ec443f1279dd (diff) |
Merge changes from github.
END_PUBLIC
---
Commit daa67ad17 authored by Jonathan Hseu<vomjom@vomjom.net>
Committed by Frank Chen<frankchn@gmail.com>:
Remove unittest import (#11596)
---
Commit 491beb74c authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
BEGIN_PUBLIC
Automated g4 rollback of changelist 162423171
PiperOrigin-RevId: 162541442
Diffstat (limited to 'tensorflow/contrib')
13 files changed, 32 insertions, 23 deletions
diff --git a/tensorflow/contrib/cluster_resolver/python/training/cluster_resolver.py b/tensorflow/contrib/cluster_resolver/python/training/cluster_resolver.py index 87da24f22d..b04822fa9d 100644 --- a/tensorflow/contrib/cluster_resolver/python/training/cluster_resolver.py +++ b/tensorflow/contrib/cluster_resolver/python/training/cluster_resolver.py @@ -75,8 +75,8 @@ class UnionClusterResolver(ClusterResolver): This class performs a union given two or more existing ClusterResolvers. It merges the underlying ClusterResolvers, and returns one unified ClusterSpec - when as_cluster_spec is called. The details of the merge function is - documented in the as_cluster_spec function. + when cluster_spec is called. The details of the merge function is + documented in the cluster_spec function. """ def __init__(self, *args): diff --git a/tensorflow/contrib/cmake/README.md b/tensorflow/contrib/cmake/README.md index 664d0f4b6b..8ad8527559 100644 --- a/tensorflow/contrib/cmake/README.md +++ b/tensorflow/contrib/cmake/README.md @@ -225,7 +225,7 @@ Step-by-step Windows build * `-Dtensorflow_ENABLE_GPU=(ON|OFF)`. Defaults to `OFF`. Include GPU support. If GPU is enabled you need to install the CUDA 8.0 Toolkit and CUDNN 5.1. - CMake will expect the location of CUDNN in -DCUDNN_HOME=path_you_unziped_cudnn. + CMake will expect the location of CUDNN in -DCUDNN_HOME=path_you_unzipped_cudnn. * `-Dtensorflow_BUILD_CC_TESTS=(ON|OFF)`. Defaults to `OFF`. This builds cc unit tests. There are many of them and building will take a few hours. diff --git a/tensorflow/contrib/framework/python/ops/variables.py b/tensorflow/contrib/framework/python/ops/variables.py index bf709f921d..411b4facdb 100644 --- a/tensorflow/contrib/framework/python/ops/variables.py +++ b/tensorflow/contrib/framework/python/ops/variables.py @@ -416,7 +416,7 @@ def get_unique_variable(var_op_name): for candidate in candidates: if candidate.op.name == var_op_name: return candidate - raise ValueError('Variable %s does not uniquely identify a variable', + raise ValueError('Variable %s does not uniquely identify a variable' % var_op_name) @@ -444,7 +444,7 @@ def assign_from_values(var_names_to_values): var_value = var_names_to_values[var_name] var = ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES, var_name) if not var: - raise ValueError('Variable %s wasnt found', var_name) + raise ValueError('Variable %s wasn\'t found' % var_name) elif len(var) > 1: # tf.get_collection is just a filter on the prefix: find the exact match: found = False @@ -455,7 +455,7 @@ def assign_from_values(var_names_to_values): break if not found: - raise ValueError('Variable %s doesnt uniquely identify a variable', + raise ValueError('Variable %s doesn\'t uniquely identify a variable' % var_name) else: var = var[0] diff --git a/tensorflow/contrib/learn/python/learn/dataframe/transforms/boolean_mask.py b/tensorflow/contrib/learn/python/learn/dataframe/transforms/boolean_mask.py index 130ac0c90f..874b02c6c9 100644 --- a/tensorflow/contrib/learn/python/learn/dataframe/transforms/boolean_mask.py +++ b/tensorflow/contrib/learn/python/learn/dataframe/transforms/boolean_mask.py @@ -35,7 +35,7 @@ def sparse_boolean_mask(sparse_tensor, mask, name="sparse_boolean_mask"): Args: sparse_tensor: a `SparseTensor`. - mask: a 1D boolean dense`Tensor` whose length is equal to the 0th dimension + mask: a 1D boolean dense `Tensor` whose length is equal to the 0th dimension of `sparse_tensor`. name: optional name for this operation. Returns: diff --git a/tensorflow/contrib/learn/python/learn/estimators/head.py b/tensorflow/contrib/learn/python/learn/estimators/head.py index fdc266d582..699a92d38a 100644 --- a/tensorflow/contrib/learn/python/learn/estimators/head.py +++ b/tensorflow/contrib/learn/python/learn/estimators/head.py @@ -25,8 +25,7 @@ import six from tensorflow.contrib import framework as framework_lib from tensorflow.contrib import layers as layers_lib from tensorflow.contrib import lookup as lookup_lib -# TODO(ptucker): Use tf.losses and tf.metrics. -from tensorflow.contrib import losses as losses_lib +# TODO(ptucker): Use tf.metrics. from tensorflow.contrib import metrics as metrics_lib from tensorflow.contrib.learn.python.learn.estimators import constants from tensorflow.contrib.learn.python.learn.estimators import model_fn @@ -44,6 +43,7 @@ from tensorflow.python.ops import sparse_ops from tensorflow.python.ops import string_ops from tensorflow.python.ops import variable_scope from tensorflow.python.ops import weights_broadcast_ops +from tensorflow.python.ops.losses import losses as losses_lib from tensorflow.python.platform import tf_logging as logging from tensorflow.python.summary import summary from tensorflow.python.training import training @@ -1212,7 +1212,8 @@ class _BinarySvmHead(_SingleHead): with ops.name_scope(None, "hinge_loss", (logits, labels)) as name: with ops.control_dependencies((_assert_labels_rank(labels),)): labels = array_ops.reshape(labels, shape=(-1, 1)) - loss = losses_lib.hinge_loss(logits=logits, labels=labels, scope=name) + loss = losses_lib.hinge_loss(labels=labels, logits=logits, scope=name, + reduction=losses_lib.Reduction.NONE) return _compute_weighted_loss(loss, weights) super(_BinarySvmHead, self).__init__( diff --git a/tensorflow/contrib/makefile/build_all_ios.sh b/tensorflow/contrib/makefile/build_all_ios.sh index 344bf49dcf..a0f5652854 100755 --- a/tensorflow/contrib/makefile/build_all_ios.sh +++ b/tensorflow/contrib/makefile/build_all_ios.sh @@ -18,7 +18,7 @@ set -e # Make sure we're on OS X. if [[ $(uname) != "Darwin" ]]; then - echo "ERROR: This makefile build requires OS X, which the current system "\ + echo "ERROR: This makefile build requires macOS, which the current system "\ "is not." exit 1 fi @@ -37,7 +37,9 @@ rm -rf tensorflow/contrib/makefile/downloads # # ld: -bind_at_load and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together # -export MACOSX_DEPLOYMENT_TARGET="10.10" +if [[ -n MACOSX_DEPLOYMENT_TARGET ]]; then + export MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion) +fi # Pull down the required versions of the frameworks we need. tensorflow/contrib/makefile/download_dependencies.sh @@ -48,6 +50,5 @@ tensorflow/contrib/makefile/compile_ios_protobuf.sh # Build the iOS TensorFlow libraries. tensorflow/contrib/makefile/compile_ios_tensorflow.sh "-O3" -# Creates a static universal library in +# Creates a static universal library in # tensorflow/contrib/makefile/gen/lib/libtensorflow-core.a - diff --git a/tensorflow/contrib/makefile/compile_ios_protobuf.sh b/tensorflow/contrib/makefile/compile_ios_protobuf.sh index e8b9454e7e..4056db18a7 100755 --- a/tensorflow/contrib/makefile/compile_ios_protobuf.sh +++ b/tensorflow/contrib/makefile/compile_ios_protobuf.sh @@ -15,9 +15,12 @@ # ============================================================================== # Builds protobuf 3 for iOS. -set -x set -e +if [[ -n MACOSX_DEPLOYMENT_TARGET ]]; then + export MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion) +fi + SCRIPT_DIR=$(dirname $0) source "${SCRIPT_DIR}/build_helper.subr" diff --git a/tensorflow/contrib/makefile/compile_ios_tensorflow.sh b/tensorflow/contrib/makefile/compile_ios_tensorflow.sh index bcf097b303..5d1cc8b375 100755 --- a/tensorflow/contrib/makefile/compile_ios_tensorflow.sh +++ b/tensorflow/contrib/makefile/compile_ios_tensorflow.sh @@ -31,6 +31,10 @@ function less_than_required_version() { ) } +if [[ -n MACOSX_DEPLOYMENT_TARGET ]]; then + export MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion) +fi + ACTUAL_XCODE_VERSION=$(xcodebuild -version | head -n 1 | sed 's/Xcode //') REQUIRED_XCODE_VERSION=7.3.0 if less_than_required_version $ACTUAL_XCODE_VERSION 7 3 0 @@ -44,7 +48,7 @@ LIBDIR=${GENDIR}lib LIB_PREFIX=libtensorflow-core make -j"${JOB_COUNT}" -f tensorflow/contrib/makefile/Makefile \ -TARGET=IOS IOS_ARCH=ARMV7 LIB_NAME=${LIB_PREFIX}-armv7.a OPTFLAGS="$1" +TARGET=IOS IOS_ARCH=ARMV7 LIB_NAME=${LIB_PREFIX}-armv7.a OPTFLAGS="$1" if [ $? -ne 0 ] then echo "armv7 compilation failed." diff --git a/tensorflow/contrib/signal/python/ops/reconstruction_ops.py b/tensorflow/contrib/signal/python/ops/reconstruction_ops.py index f5f443ad09..653c030a04 100644 --- a/tensorflow/contrib/signal/python/ops/reconstruction_ops.py +++ b/tensorflow/contrib/signal/python/ops/reconstruction_ops.py @@ -37,7 +37,7 @@ def _shuffle_to_front(input_tensor, k): k: A scalar `Tensor` specifying how many indices to shuffle. Returns: - A tranposed version of `input_tensor` with `k` indices shuffled to the + A transposed version of `input_tensor` with `k` indices shuffled to the front. Raises: diff --git a/tensorflow/contrib/slim/python/slim/evaluation.py b/tensorflow/contrib/slim/python/slim/evaluation.py index 15c9f3d3f4..2d4b08df61 100644 --- a/tensorflow/contrib/slim/python/slim/evaluation.py +++ b/tensorflow/contrib/slim/python/slim/evaluation.py @@ -81,7 +81,7 @@ more summaries and call the evaluation_loop method: # Evaluate every 10 minutes: slim.evaluation_loop( - master='', + '', checkpoint_dir, logdir, num_evals=num_evals, diff --git a/tensorflow/contrib/tfprof/README.md b/tensorflow/contrib/tfprof/README.md index eefd88793e..7faf2b9b24 100644 --- a/tensorflow/contrib/tfprof/README.md +++ b/tensorflow/contrib/tfprof/README.md @@ -1,9 +1,9 @@ # tfprof: TensorFlow Profiler and Beyond <h1>Please use `tf.profiler.xxx` instead of `tf.contrib.tfprof.xxx`</h1> -<h1>Full Document in tensorflow/core/profiler/README.md<h1> +<h1>Full Document in <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/profiler/README.md">tensorflow/core/profiler/README.md</a><h1> -###Features +### Features * Profile model architectures * parameters, tensor shapes, float operations, device placement, etc. @@ -16,7 +16,7 @@ * operation configuration check * distributed runtime check (Not OSS) -###Interfaces +### Interfaces * Python API * Command Line diff --git a/tensorflow/contrib/timeseries/python/timeseries/model.py b/tensorflow/contrib/timeseries/python/timeseries/model.py index e6c60fdf0c..f2ef8d2211 100644 --- a/tensorflow/contrib/timeseries/python/timeseries/model.py +++ b/tensorflow/contrib/timeseries/python/timeseries/model.py @@ -353,7 +353,7 @@ class SequentialTimeSeriesModel(TimeSeriesModel): Args: current_times: A [batch size] Tensor of times for each observation. - current_values: A [batch size] Tensor of values for each observaiton. + current_values: A [batch size] Tensor of values for each observation. state: Model state, updated to current_times. predictions: The outputs of _prediction_step Returns: diff --git a/tensorflow/contrib/timeseries/python/timeseries/state_space_models/state_space_model.py b/tensorflow/contrib/timeseries/python/timeseries/state_space_models/state_space_model.py index 3193d5607c..6a9660b400 100644 --- a/tensorflow/contrib/timeseries/python/timeseries/state_space_models/state_space_model.py +++ b/tensorflow/contrib/timeseries/python/timeseries/state_space_models/state_space_model.py @@ -391,7 +391,7 @@ class StateSpaceModel(model.SequentialTimeSeriesModel): Args: current_times: A [batch size] Tensor for times for each observation. - current_values: A [batch size] Tensor of values for each observaiton. + current_values: A [batch size] Tensor of values for each observation. state: A tuple of (mean, covariance, previous_times) having shapes mean; [batch size x state dimension] covariance; [batch size x state dimension x state dimension] |