_DEFAULT_CUDA_PATH_LINUX = '/opt/cuda'
_DEFAULT_CUDA_PATH_WIN = ('C:/Program Files/NVIDIA GPU Computing '
'Toolkit/CUDA/v%s' % _DEFAULT_CUDA_VERSION)
-_DEFAULT_TENSORRT_PATH_LINUX = '/usr/lib/x86_64-linux-gnu'
+_DEFAULT_TENSORRT_PATH_LINUX = '/usr/lib/%s-linux-gnu' % platform.machine()
_TF_OPENCL_VERSION = '1.2'
_DEFAULT_COMPUTECPP_TOOLKIT_PATH = '/usr/local/computecpp'
_DEFAULT_TRISYCL_INCLUDE_DIR = '/usr/local/triSYCL/include'
This transformation maps each consecutive element in a dataset to a key
using `key_func` and groups the elements by key. It then applies
`reduce_func` to at most `window_size_func(key)` elements matching the same
- key. All execpt the final window for each key will contain
+ key. All except the final window for each key will contain
`window_size_func(key)` elements; the final window may be smaller.
You may provide either a constant `window_size` or a window size determined by
out = tf.identity(val, name="out")
with tf.Session() as sess:
tflite_model = tf.contrib.lite.toco_convert(sess.graph_def, [img], [out])
- open("test.tflite", "wb").write(tflite_modeL)
+ open("test.tflite", "wb").write(tflite_model)
```
**NOTE** Currently, the TOCO command will cause a fatal error to the Python
};
#define _TF_LOG_INFO \
- ::tensorflow::internal::LogMessage(__FILE__, __LINE__, tensorflow::INFO)
+ ::tensorflow::internal::LogMessage(__FILE__, __LINE__, ::tensorflow::INFO)
#define _TF_LOG_WARNING \
- ::tensorflow::internal::LogMessage(__FILE__, __LINE__, tensorflow::WARNING)
+ ::tensorflow::internal::LogMessage(__FILE__, __LINE__, ::tensorflow::WARNING)
#define _TF_LOG_ERROR \
- ::tensorflow::internal::LogMessage(__FILE__, __LINE__, tensorflow::ERROR)
+ ::tensorflow::internal::LogMessage(__FILE__, __LINE__, ::tensorflow::ERROR)
#define _TF_LOG_FATAL \
::tensorflow::internal::LogMessageFatal(__FILE__, __LINE__)
Next, you must build a shared object containing this implementation. An example
of doing so using bazel's `cc_binary` rule can be found
[here](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/BUILD#L244),
-but you may use any build system to do so. See the section on @{$adding_an_op#build-the-op-library$building the op library} for similar
+but you may use any build system to do so. See the section on @{$adding_an_op#build_the_op_library$building the op library} for similar
instructions.
The result of building this target is a `.so` shared object file.
```
The last step is to add the Python wrapper. You can either do this by
-@{$adding_an_op#building_the_op_library$compiling a dynamic library}
+@{$adding_an_op#build_the_op_library$compiling a dynamic library}
or, if you are building TensorFlow from source, adding to `user_ops.py`.
For the latter, you will import `tensorflow.python.ops.io_ops` in
[`tensorflow/python/user_ops/user_ops.py`](https://www.tensorflow.org/code/tensorflow/python/user_ops/user_ops.py)
### Input Layer
The methods in the `layers` module for creating convolutional and pooling layers
-for two-dimensional image data expect input tensors to have a shape of
-<code>[<em>batch_size</em>, <em>image_width</em>, <em>image_height</em>,
-<em>channels</em>]</code>, defined as follows:
+for two-dimensional image data expect input tensors to have a `channels_last` shape of
+<code>[<em>batch_size</em>, <em>image_height</em>, <em>image_width</em>, <em>channels</em>]</code>
+or a `channels_first` shape of <code>[<em>batch_size</em>, <em>channels</em>, <em>image_height</em>, <em>image_width</em>]</code>, defined as follows:
* _`batch_size`_. Size of the subset of examples to use when performing
gradient descent during training.
Either a single value if `fetches` is a single graph element, or
a list of values if `fetches` is a list, or a dictionary with the
same keys as `fetches` if that is a dictionary (described above).
+ Order in which `fetches` operations are evaluated inside the call
+ is undefined.
Raises:
RuntimeError: If this `Session` is in an invalid state (e.g. has been
from tensorflow.python.ops import gen_nn_ops
from tensorflow.python.ops import gen_sparse_ops
from tensorflow.python.ops import gen_spectral_ops
+from tensorflow.python.platform import tf_logging as logging
# go/tf-wildcard-import
# pylint: disable=wildcard-import
from tensorflow.python.ops.gen_math_ops import *
with ops.name_scope(name, "Cast", [x]) as name:
if isinstance(x, sparse_tensor.SparseTensor):
values_cast = cast(x.values, base_type, name=name)
- return sparse_tensor.SparseTensor(x.indices, values_cast, x.dense_shape)
+ x = sparse_tensor.SparseTensor(x.indices, values_cast, x.dense_shape)
else:
# TODO(josh11b): If x is not already a Tensor, we could return
# ops.convert_to_tensor(x, dtype=dtype, ...) here, but that
# allows some conversions that cast() can't do, e.g. casting numbers to
# strings.
x = ops.convert_to_tensor(x, name="x")
- if x.dtype.base_dtype == base_type:
- return x
- return gen_math_ops.cast(x, base_type, name=name)
+ if x.dtype.base_dtype != base_type:
+ x = gen_math_ops.cast(x, base_type, name=name)
+ if x.dtype.is_complex and base_type.is_floating:
+ logging.warn("Casting complex to real discards imaginary part.")
+ return x
@tf_export("saturate_cast")
#
# collections.OrderedDict([
# ((0, 0, 0), 2),
- # ((0, 0, 1), 3),
+ # ((0, 1, 0), 3),
# ])
```
from six import text_type
from google.cloud import datastore
+from six import text_type
def is_real_file(dirpath, fname):
name = "using_sycl_trisycl",
define_values = {
"using_sycl": "true",
- "using_trisycl": "false",
+ "using_trisycl": "true",
},
)