forked from tensorflow/tensorflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
END_PUBLIC --- Commit c2b8927 authored by Dandelion Man?<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Fix another d3v4 regression in the graph visualizer. PiperOrigin-RevId: 156343038 --- Commit 170f0b3 authored by Peter Hawkins<[email protected]> Committed by TensorFlower Gardener<[email protected]>: [TF:XLA] Add XLA implementation of ResourceStridedSliceAssign. PiperOrigin-RevId: 156341053 --- Commit 1390dd6 authored by Vijay Vasudevan<[email protected]> Committed by TensorFlower Gardener<[email protected]>: When Op Type is not registered, log the hostname of the machine that it is running on in the error message, since the message could be routed back during a failure on a remote binary, and it is hard to tell which machine it came from. Ideally, we'd somehow log the name of the binary running instead, but we don't have a function to get that right now. PiperOrigin-RevId: 156337679 --- Commit 9ca8a15 authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Internal change. PiperOrigin-RevId: 156335942 --- Commit 4025543 authored by Martin Wicke<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Deprecate contrib/learn/dataframe. To be removed June 15. PiperOrigin-RevId: 156333930 --- Commit 7f71b7f authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: BEGIN_PUBLIC Automated g4 rollback of changelist 156123287 PiperOrigin-RevId: 156503903
- Loading branch information
1 parent
c311af0
commit 53cb26d
Showing
123 changed files
with
1,973 additions
and
502 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ============================================================================== | ||
|
||
TF_PREFIX='/usr/local' | ||
|
||
usage() { | ||
echo "Usage: $0 OPTIONS" | ||
echo -e "-p, --prefix\tset installation prefix (default: /usr/local)" | ||
echo -e "-v, --version\tset TensorFlow version" | ||
echo -e "-h, --help\tdisplay this message" | ||
} | ||
|
||
# read the options | ||
ARGS=`getopt -o p:v:h --long prefix:,version:,help -n $0 -- "$@"` | ||
eval set -- "$ARGS" | ||
|
||
# extract options and their arguments into variables. | ||
while true ; do | ||
case "$1" in | ||
-h|--help) usage ; exit ;; | ||
-p|--prefix) | ||
case "$2" in | ||
"") shift 2 ;; | ||
*) TF_PREFIX=$2 ; shift 2 ;; | ||
esac ;; | ||
-v|--version) | ||
case "$2" in | ||
"") shift 2 ;; | ||
*) TF_VERSION=$2 ; shift 2 ;; | ||
esac ;; | ||
--) shift ; echo "Try '$0 --help' for more information."; exit 1 ;; | ||
*) echo "Internal error! Try '$0 --help' for more information." ; exit 1 ;; | ||
esac | ||
done | ||
|
||
echo "Generating pkgconfig file for TensorFlow $TF_VERSION in $TF_PREFIX" | ||
|
||
cat << EOF > tensorflow.pc | ||
prefix=${TF_PREFIX} | ||
exec_prefix=\${prefix} | ||
libdir=\${exec_prefix}/lib | ||
includedir=\${prefix}/include | ||
Name: TensorFlow | ||
Version: ${TF_VERSION} | ||
Description: Library for computation using data flow graphs for scalable machine learning | ||
Requires: | ||
Libs: -L\${libdir} -ltensorflow | ||
Cflags: -I\${includedir} | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ============================================================================== | ||
"""Tests for slicing.""" | ||
|
||
from __future__ import absolute_import | ||
from __future__ import division | ||
from __future__ import print_function | ||
|
||
import numpy as np | ||
|
||
from tensorflow.compiler.tests.xla_test import XLATestCase | ||
from tensorflow.python.framework import dtypes | ||
from tensorflow.python.ops import array_ops | ||
from tensorflow.python.platform import googletest | ||
|
||
|
||
class SliceTest(XLATestCase): | ||
|
||
def test1D(self): | ||
for dtype in self.numeric_types: | ||
with self.test_session(): | ||
i = array_ops.placeholder(dtype, shape=[10]) | ||
with self.test_scope(): | ||
o = array_ops.slice(i, [2], [4]) | ||
params = { | ||
i: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], | ||
} | ||
result = o.eval(feed_dict=params) | ||
|
||
self.assertAllEqual([2, 3, 4, 5], result) | ||
|
||
def test3D(self): | ||
for dtype in self.numeric_types: | ||
with self.test_session(): | ||
i = array_ops.placeholder(dtype, shape=[3, 3, 10]) | ||
with self.test_scope(): | ||
o = array_ops.slice(i, [1, 2, 2], [1, 1, 4]) | ||
params = { | ||
i: [[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], | ||
[5, 3, 1, 7, 9, 2, 4, 6, 8, 0]], | ||
[[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | ||
[8, 7, 6, 5, 4, 3, 2, 1, 8, 7]], | ||
[[7, 5, 7, 5, 7, 5, 7, 5, 7, 5], [1, 2, 1, 2, 1, 2, 1, 2, 1, 2], | ||
[9, 8, 7, 9, 8, 7, 9, 8, 7, 9]]] | ||
} | ||
result = o.eval(feed_dict=params) | ||
|
||
self.assertAllEqual([[[6, 5, 4, 3]]], result) | ||
|
||
|
||
class StridedSliceTest(XLATestCase): | ||
|
||
def test1D(self): | ||
for dtype in self.numeric_types: | ||
with self.test_session(): | ||
i = array_ops.placeholder(dtype, shape=[10]) | ||
with self.test_scope(): | ||
o = array_ops.strided_slice(i, [2], [6], [2]) | ||
params = { | ||
i: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], | ||
} | ||
result = o.eval(feed_dict=params) | ||
|
||
self.assertAllEqual([2, 4], result) | ||
|
||
def test1DNegtiveStride(self): | ||
for dtype in self.numeric_types: | ||
with self.test_session(): | ||
i = array_ops.placeholder(dtype, shape=[10]) | ||
with self.test_scope(): | ||
o = array_ops.strided_slice(i, [6], [2], [-2]) | ||
params = { | ||
i: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], | ||
} | ||
result = o.eval(feed_dict=params) | ||
|
||
self.assertAllEqual([6, 4], result) | ||
|
||
def test3D(self): | ||
for dtype in self.numeric_types: | ||
with self.test_session(): | ||
i = array_ops.placeholder(dtype, shape=[3, 3, 10]) | ||
with self.test_scope(): | ||
o = array_ops.strided_slice(i, [0, 2, 2], [2, 3, 6], [1, 1, 2]) | ||
params = { | ||
i: [[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], | ||
[5, 3, 1, 7, 9, 2, 4, 6, 8, 0]], | ||
[[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | ||
[8, 7, 6, 5, 4, 3, 2, 1, 8, 7]], | ||
[[7, 5, 7, 5, 7, 5, 7, 5, 7, 5], [1, 2, 1, 2, 1, 2, 1, 2, 1, 2], | ||
[9, 8, 7, 9, 8, 7, 9, 8, 7, 9]]] | ||
} | ||
result = o.eval(feed_dict=params) | ||
|
||
self.assertAllEqual([[[1, 9]], [[6, 4]]], result) | ||
|
||
def test3DNegativeStride(self): | ||
for dtype in self.numeric_types: | ||
with self.test_session(): | ||
i = array_ops.placeholder(dtype, shape=[3, 4, 10]) | ||
with self.test_scope(): | ||
o = array_ops.strided_slice(i, [2, 2, 6], [0, 0, 2], [-1, -1, -2]) | ||
params = { | ||
i: [[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], | ||
[5, 3, 1, 7, 9, 2, 4, 6, 8, 0], [4, 5, 2, 4, 3, 7, 6, 8, 9, | ||
4]], | ||
[[5, 5, 5, 5, 5, 5, 5, 5, 5, 5], [4, 3, 4, 5, 7, 6, 5, 3, 4, 5], | ||
[8, 7, 6, 5, 4, 3, 2, 1, 8, 7], [7, 1, 7, 1, 8, 1, 8, 1, 3, | ||
1]], | ||
[[7, 5, 7, 5, 7, 5, 7, 5, 7, 5], [1, 2, 1, 2, 1, 2, 1, 2, 1, 2], | ||
[9, 8, 7, 9, 8, 7, 9, 8, 7, 9], [9, 9, 5, 5, 6, 6, 3, 3, 6, | ||
6]]] | ||
} | ||
result = o.eval(feed_dict=params) | ||
|
||
self.assertAllEqual([[[9, 8], [1, 1]], [[2, 4], [5, 7]]], result) | ||
|
||
|
||
if __name__ == "__main__": | ||
googletest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.