diff options
author | Vijay Vasudevan <vrv@google.com> | 2015-11-18 10:47:35 -0800 |
---|---|---|
committer | Vijay Vasudevan <vrv@google.com> | 2015-11-18 10:47:35 -0800 |
commit | ab34d55ce7618e52069a2e1c9e51aac5a1ea81c3 (patch) | |
tree | 9c79427b45ff6501e8374ceb7b4fc3bdb2828e15 /tensorflow/g3doc/api_docs/python/constant_op.md | |
parent | 9eb88d56ab6a9a361662d73a258593d8fbf10b62 (diff) |
TensorFlow: more features, performance improvements, and doc fixes.
Changes:
- Add Split/Concat() methods to TensorUtil (meant for convenience, not
speed) by Chris.
- Changes to linear algebra ops interface by Rasmus
- Tests for tensorboard by Daniel
- Fix bug in histogram calculation by Cassandra
- Added tool for backwards compatibility of OpDefs. Tool
Checks in history of opdefs and their changes, checks for
backwards-incompatible changes. All done by @josh11b
- Fix some protobuf example proto docs by Oliver
- Add derivative of MatrixDeterminant by @yaroslavvb
- Add a priority queue queue by @ebrevdo
- Doc and typo fixes by Aurelien and @dave-andersen
- Speed improvements to ConvBackwardFilter by @andydavis
- Improve speed of Alexnet on TitanX by @zheng-xq
- Add some host memory annotations to some GPU kernels by Yuan.
- Add support for doubles in histogram summary by @jmchen-g
Base CL: 108158338
Diffstat (limited to 'tensorflow/g3doc/api_docs/python/constant_op.md')
-rw-r--r-- | tensorflow/g3doc/api_docs/python/constant_op.md | 112 |
1 files changed, 45 insertions, 67 deletions
diff --git a/tensorflow/g3doc/api_docs/python/constant_op.md b/tensorflow/g3doc/api_docs/python/constant_op.md index 0e3abf6676..13aa64aef7 100644 --- a/tensorflow/g3doc/api_docs/python/constant_op.md +++ b/tensorflow/g3doc/api_docs/python/constant_op.md @@ -1,41 +1,19 @@ <!-- This file is machine generated: DO NOT EDIT! --> -# Constants, Sequences, and Random Values <a class="md-anchor" id="AUTOGENERATED-constants--sequences--and-random-values"></a> +# Constants, Sequences, and Random Values Note: Functions taking `Tensor` arguments can also take anything accepted by [`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor). -<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! --> -## Contents -### [Constants, Sequences, and Random Values](#AUTOGENERATED-constants--sequences--and-random-values) -* [Constant Value Tensors](#AUTOGENERATED-constant-value-tensors) - * [`tf.zeros(shape, dtype=tf.float32, name=None)`](#zeros) - * [`tf.zeros_like(tensor, dtype=None, name=None)`](#zeros_like) - * [`tf.ones(shape, dtype=tf.float32, name=None)`](#ones) - * [`tf.ones_like(tensor, dtype=None, name=None)`](#ones_like) - * [`tf.fill(dims, value, name=None)`](#fill) - * [`tf.constant(value, dtype=None, shape=None, name='Const')`](#constant) -* [Sequences](#AUTOGENERATED-sequences) - * [`tf.linspace(start, stop, num, name=None)`](#linspace) - * [`tf.range(start, limit=None, delta=1, name='range')`](#range) -* [Random Tensors](#AUTOGENERATED-random-tensors) - * [Examples:](#AUTOGENERATED-examples-) - * [`tf.random_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)`](#random_normal) - * [`tf.truncated_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)`](#truncated_normal) - * [`tf.random_uniform(shape, minval=0.0, maxval=1.0, dtype=tf.float32, seed=None, name=None)`](#random_uniform) - * [`tf.random_shuffle(value, seed=None, name=None)`](#random_shuffle) - * [`tf.set_random_seed(seed)`](#set_random_seed) - - -<!-- TOC-END This section was generated by neural network, THANKS FOR READING! --> - -## Constant Value Tensors <a class="md-anchor" id="AUTOGENERATED-constant-value-tensors"></a> +[TOC] + +## Constant Value Tensors TensorFlow provides several operations that you can use to generate constants. - - - -### `tf.zeros(shape, dtype=tf.float32, name=None)` <a class="md-anchor" id="zeros"></a> +### `tf.zeros(shape, dtype=tf.float32, name=None)` {#zeros} Creates a tensor with all elements set to zero. @@ -48,21 +26,21 @@ For example: tf.zeros([3, 4], int32) ==> [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]] ``` -##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> +##### Args: * <b>`shape`</b>: Either a list of integers, or a 1-D `Tensor` of type `int32`. * <b>`dtype`</b>: The type of an element in the resulting `Tensor`. * <b>`name`</b>: A name for the operation (optional). -##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> +##### Returns: A `Tensor` with all elements set to zero. - - - -### `tf.zeros_like(tensor, dtype=None, name=None)` <a class="md-anchor" id="zeros_like"></a> +### `tf.zeros_like(tensor, dtype=None, name=None)` {#zeros_like} Creates a tensor with all elements set to zero. @@ -77,7 +55,7 @@ For example: tf.zeros_like(tensor) ==> [[0, 0, 0], [0, 0, 0]] ``` -##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> +##### Args: * <b>`tensor`</b>: A `Tensor`. @@ -86,7 +64,7 @@ tf.zeros_like(tensor) ==> [[0, 0, 0], [0, 0, 0]] * <b>`name`</b>: A name for the operation (optional). -##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> +##### Returns: A `Tensor` with all elements set to zero. @@ -94,7 +72,7 @@ tf.zeros_like(tensor) ==> [[0, 0, 0], [0, 0, 0]] - - - -### `tf.ones(shape, dtype=tf.float32, name=None)` <a class="md-anchor" id="ones"></a> +### `tf.ones(shape, dtype=tf.float32, name=None)` {#ones} Creates a tensor with all elements set to 1. @@ -107,21 +85,21 @@ For example: tf.ones([2, 3], int32) ==> [[1, 1, 1], [1, 1, 1]] ``` -##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> +##### Args: * <b>`shape`</b>: Either a list of integers, or a 1-D `Tensor` of type `int32`. * <b>`dtype`</b>: The type of an element in the resulting `Tensor`. * <b>`name`</b>: A name for the operation (optional). -##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> +##### Returns: A `Tensor` with all elements set to 1. - - - -### `tf.ones_like(tensor, dtype=None, name=None)` <a class="md-anchor" id="ones_like"></a> +### `tf.ones_like(tensor, dtype=None, name=None)` {#ones_like} Creates a tensor with all elements set to 1. @@ -136,7 +114,7 @@ For example: tf.ones_like(tensor) ==> [[1, 1, 1], [1, 1, 1]] ``` -##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> +##### Args: * <b>`tensor`</b>: A `Tensor`. @@ -145,7 +123,7 @@ tf.ones_like(tensor) ==> [[1, 1, 1], [1, 1, 1]] * <b>`name`</b>: A name for the operation (optional). -##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> +##### Returns: A `Tensor` with all elements set to 1. @@ -153,7 +131,7 @@ tf.ones_like(tensor) ==> [[1, 1, 1], [1, 1, 1]] - - - -### `tf.fill(dims, value, name=None)` <a class="md-anchor" id="fill"></a> +### `tf.fill(dims, value, name=None)` {#fill} Creates a tensor filled with a scalar value. @@ -168,7 +146,7 @@ fill(dims, 9) ==> [[9, 9, 9] [9, 9, 9]] ``` -##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> +##### Args: * <b>`dims`</b>: A `Tensor` of type `int32`. @@ -176,7 +154,7 @@ fill(dims, 9) ==> [[9, 9, 9] * <b>`value`</b>: A `Tensor`. 0-D (scalar). Value to fill the returned tensor. * <b>`name`</b>: A name for the operation (optional). -##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> +##### Returns: A `Tensor`. Has the same type as `value`. @@ -184,7 +162,7 @@ fill(dims, 9) ==> [[9, 9, 9] - - - -### `tf.constant(value, dtype=None, shape=None, name='Const')` <a class="md-anchor" id="constant"></a> +### `tf.constant(value, dtype=None, shape=None, name='Const')` {#constant} Creates a constant tensor. @@ -217,7 +195,7 @@ Creates a constant tensor. [-1. -1. -1.]] ``` -##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> +##### Args: * <b>`value`</b>: A constant value (or list) of output type `dtype`. @@ -231,17 +209,17 @@ Creates a constant tensor. * <b>`name`</b>: Optional name for the tensor. -##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> +##### Returns: A Constant Tensor. -## Sequences <a class="md-anchor" id="AUTOGENERATED-sequences"></a> +## Sequences - - - -### `tf.linspace(start, stop, num, name=None)` <a class="md-anchor" id="linspace"></a> +### `tf.linspace(start, stop, num, name=None)` {#linspace} Generates values in an interval. @@ -255,7 +233,7 @@ For example: tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0 11.0 12.0] ``` -##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> +##### Args: * <b>`start`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`. @@ -265,7 +243,7 @@ tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0 11.0 12.0] * <b>`num`</b>: A `Tensor` of type `int32`. Number of values to generate. * <b>`name`</b>: A name for the operation (optional). -##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> +##### Returns: A `Tensor`. Has the same type as `start`. 1-D. The generated values. @@ -273,7 +251,7 @@ tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0 11.0 12.0] - - - -### `tf.range(start, limit=None, delta=1, name='range')` <a class="md-anchor" id="range"></a> +### `tf.range(start, limit=None, delta=1, name='range')` {#range} Creates a sequence of integers. @@ -295,7 +273,7 @@ tf.range(start, limit, delta) ==> [3, 6, 9, 12, 15] tf.range(limit) ==> [0, 1, 2, 3, 4] ``` -##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> +##### Args: * <b>`start`</b>: A 0-D (scalar) of type `int32`. First entry in sequence. @@ -306,13 +284,13 @@ tf.range(limit) ==> [0, 1, 2, 3, 4] Number that increments `start`. * <b>`name`</b>: A name for the operation (optional). -##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> +##### Returns: An 1-D `int32` `Tensor`. -## Random Tensors <a class="md-anchor" id="AUTOGENERATED-random-tensors"></a> +## Random Tensors TensorFlow has several ops that create random tensors with different distributions. The random ops are stateful, and create new random values each @@ -328,7 +306,7 @@ See [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) for details on the interaction between operation-level and graph-level random seeds. -### Examples: <a class="md-anchor" id="AUTOGENERATED-examples-"></a> +### Examples: ```python # Create a tensor of shape [2, 3] consisting of random normal values, with mean @@ -368,11 +346,11 @@ print sess.run(var) - - - -### `tf.random_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)` <a class="md-anchor" id="random_normal"></a> +### `tf.random_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)` {#random_normal} Outputs random values from a normal distribution. -##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> +##### Args: * <b>`shape`</b>: A 1-D integer Tensor or Python array. The shape of the output tensor. @@ -387,14 +365,14 @@ Outputs random values from a normal distribution. for behavior. * <b>`name`</b>: A name for the operation (optional). -##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> +##### Returns: A tensor of the specified shape filled with random normal values. - - - -### `tf.truncated_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)` <a class="md-anchor" id="truncated_normal"></a> +### `tf.truncated_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)` {#truncated_normal} Outputs random values from a truncated normal distribution. @@ -402,7 +380,7 @@ The generated values follow a normal distribution with specified mean and standard deviation, except that values whose magnitude is more than 2 standard deviations from the mean are dropped and re-picked. -##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> +##### Args: * <b>`shape`</b>: A 1-D integer Tensor or Python array. The shape of the output tensor. @@ -417,14 +395,14 @@ deviations from the mean are dropped and re-picked. for behavior. * <b>`name`</b>: A name for the operation (optional). -##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> +##### Returns: A tensor of the specified shape filled with random truncated normal values. - - - -### `tf.random_uniform(shape, minval=0.0, maxval=1.0, dtype=tf.float32, seed=None, name=None)` <a class="md-anchor" id="random_uniform"></a> +### `tf.random_uniform(shape, minval=0.0, maxval=1.0, dtype=tf.float32, seed=None, name=None)` {#random_uniform} Outputs random values from a uniform distribution. @@ -432,7 +410,7 @@ The generated values follow a uniform distribution in the range `[minval, maxval)`. The lower bound `minval` is included in the range, while the upper bound `maxval` is excluded. -##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> +##### Args: * <b>`shape`</b>: A 1-D integer Tensor or Python array. The shape of the output tensor. @@ -447,14 +425,14 @@ the upper bound `maxval` is excluded. for behavior. * <b>`name`</b>: A name for the operation (optional). -##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> +##### Returns: A tensor of the specified shape filled with random uniform values. - - - -### `tf.random_shuffle(value, seed=None, name=None)` <a class="md-anchor" id="random_shuffle"></a> +### `tf.random_shuffle(value, seed=None, name=None)` {#random_shuffle} Randomly shuffles a tensor along its first dimension. @@ -468,7 +446,7 @@ to one and only one `output[i]`. For example, a mapping that might occur for a [5, 6]] [3, 4]] ``` -##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> +##### Args: * <b>`value`</b>: A Tensor to be shuffled. @@ -478,7 +456,7 @@ to one and only one `output[i]`. For example, a mapping that might occur for a for behavior. * <b>`name`</b>: A name for the operation (optional). -##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> +##### Returns: A tensor of same shape and type as `value`, shuffled along its first dimension. @@ -486,7 +464,7 @@ to one and only one `output[i]`. For example, a mapping that might occur for a - - - -### `tf.set_random_seed(seed)` <a class="md-anchor" id="set_random_seed"></a> +### `tf.set_random_seed(seed)` {#set_random_seed} Sets the graph-level random seed. @@ -579,7 +557,7 @@ with tf.Session() as sess2: print sess2.run(b) # generates 'B2' ``` -##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> +##### Args: * <b>`seed`</b>: integer. |