LostTech.TensorFlow : API Documentation

Type tf.keras.backend

Namespace tensorflow

Methods

Properties

Public static methods

object abs(object x)

Element-wise absolute value.
Parameters
object x
Tensor or variable.
Returns
object
A tensor.

object abs_dyn(object x)

Element-wise absolute value.
Parameters
object x
Tensor or variable.
Returns
object
A tensor.

Tensor all(IGraphNodeBase x, Nullable<int> axis, bool keepdims)

Bitwise reduction (logical AND).
Parameters
IGraphNodeBase x
Tensor or variable.
Nullable<int> axis
axis along which to perform the reduction.
bool keepdims
whether the drop or broadcast the reduction axes.
Returns
Tensor
A uint8 tensor (0s and 1s).

Tensor all(IEnumerator<bool> x, Nullable<int> axis, bool keepdims)

Bitwise reduction (logical AND).
Parameters
IEnumerator<bool> x
Tensor or variable.
Nullable<int> axis
axis along which to perform the reduction.
bool keepdims
whether the drop or broadcast the reduction axes.
Returns
Tensor
A uint8 tensor (0s and 1s).

Tensor all(IEnumerable<Nullable<int>> x, Nullable<int> axis, bool keepdims)

Bitwise reduction (logical AND).
Parameters
IEnumerable<Nullable<int>> x
Tensor or variable.
Nullable<int> axis
axis along which to perform the reduction.
bool keepdims
whether the drop or broadcast the reduction axes.
Returns
Tensor
A uint8 tensor (0s and 1s).

object all_dyn(object x, object axis, ImplicitContainer<T> keepdims)

Bitwise reduction (logical AND).
Parameters
object x
Tensor or variable.
object axis
axis along which to perform the reduction.
ImplicitContainer<T> keepdims
whether the drop or broadcast the reduction axes.
Returns
object
A uint8 tensor (0s and 1s).

Tensor any(object x, Nullable<int> axis, bool keepdims)

Bitwise reduction (logical OR).
Parameters
object x
Tensor or variable.
Nullable<int> axis
axis along which to perform the reduction.
bool keepdims
whether the drop or broadcast the reduction axes.
Returns
Tensor
A uint8 tensor (0s and 1s).

Tensor any(PythonFunctionContainer x, Nullable<int> axis, bool keepdims)

Bitwise reduction (logical OR).
Parameters
PythonFunctionContainer x
Tensor or variable.
Nullable<int> axis
axis along which to perform the reduction.
bool keepdims
whether the drop or broadcast the reduction axes.
Returns
Tensor
A uint8 tensor (0s and 1s).

Tensor any(IGraphNodeBase x, Nullable<int> axis, bool keepdims)

Bitwise reduction (logical OR).
Parameters
IGraphNodeBase x
Tensor or variable.
Nullable<int> axis
axis along which to perform the reduction.
bool keepdims
whether the drop or broadcast the reduction axes.
Returns
Tensor
A uint8 tensor (0s and 1s).

Tensor any(IEnumerator<bool> x, Nullable<int> axis, bool keepdims)

Bitwise reduction (logical OR).
Parameters
IEnumerator<bool> x
Tensor or variable.
Nullable<int> axis
axis along which to perform the reduction.
bool keepdims
whether the drop or broadcast the reduction axes.
Returns
Tensor
A uint8 tensor (0s and 1s).

Tensor any(IEnumerable<object> x, Nullable<int> axis, bool keepdims)

Bitwise reduction (logical OR).
Parameters
IEnumerable<object> x
Tensor or variable.
Nullable<int> axis
axis along which to perform the reduction.
bool keepdims
whether the drop or broadcast the reduction axes.
Returns
Tensor
A uint8 tensor (0s and 1s).

object any_dyn(object x, object axis, ImplicitContainer<T> keepdims)

Bitwise reduction (logical OR).
Parameters
object x
Tensor or variable.
object axis
axis along which to perform the reduction.
ImplicitContainer<T> keepdims
whether the drop or broadcast the reduction axes.
Returns
object
A uint8 tensor (0s and 1s).

object arange(object start, object stop, int step, string dtype)

Creates a 1D tensor containing a sequence of integers.

The function arguments use the same convention as Theano's arange: if only one argument is provided, it is in fact the "stop" argument and "start" is 0.

The default type of the returned tensor is `'int32'` to match TensorFlow's default.
Parameters
object start
Start value.
object stop
Stop value.
int step
Difference between two successive values.
string dtype
Integer dtype to use.
Returns
object
An integer tensor.

Example: ```python >>> tf.keras.backend.arange(start=0, stop=10, step=1.5)

```

object arange_dyn(object start, object stop, ImplicitContainer<T> step, ImplicitContainer<T> dtype)

Creates a 1D tensor containing a sequence of integers.

The function arguments use the same convention as Theano's arange: if only one argument is provided, it is in fact the "stop" argument and "start" is 0.

The default type of the returned tensor is `'int32'` to match TensorFlow's default.
Parameters
object start
Start value.
object stop
Stop value.
ImplicitContainer<T> step
Difference between two successive values.
ImplicitContainer<T> dtype
Integer dtype to use.
Returns
object
An integer tensor.

Example: ```python >>> tf.keras.backend.arange(start=0, stop=10, step=1.5)

```

Tensor argmax(object x, int axis)

Returns the index of the maximum value along an axis.
Parameters
object x
Tensor or variable.
int axis
axis along which to perform the reduction.
Returns
Tensor
A tensor.

object argmax_dyn(object x, ImplicitContainer<T> axis)

Returns the index of the maximum value along an axis.
Parameters
object x
Tensor or variable.
ImplicitContainer<T> axis
axis along which to perform the reduction.
Returns
object
A tensor.

Tensor argmin(object x, int axis)

Returns the index of the minimum value along an axis.
Parameters
object x
Tensor or variable.
int axis
axis along which to perform the reduction.
Returns
Tensor
A tensor.

object argmin_dyn(object x, ImplicitContainer<T> axis)

Returns the index of the minimum value along an axis.
Parameters
object x
Tensor or variable.
ImplicitContainer<T> axis
axis along which to perform the reduction.
Returns
object
A tensor.

string backend_()

object backend__dyn()

Tensor batch_dot(IGraphNodeBase x, IEnumerable<object> y, int axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IGraphNodeBase x
Keras tensor or variable with `ndim >= 2`.
IEnumerable<object> y
Keras tensor or variable with `ndim >= 2`.
int axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_dot(IGraphNodeBase x, ReplicatedVariable y, IEnumerable<int> axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IGraphNodeBase x
Keras tensor or variable with `ndim >= 2`.
ReplicatedVariable y
Keras tensor or variable with `ndim >= 2`.
IEnumerable<int> axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_dot(IGraphNodeBase x, ReplicatedVariable y, int axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IGraphNodeBase x
Keras tensor or variable with `ndim >= 2`.
ReplicatedVariable y
Keras tensor or variable with `ndim >= 2`.
int axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_dot(IGraphNodeBase x, ResourceVariable y, IEnumerable<int> axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IGraphNodeBase x
Keras tensor or variable with `ndim >= 2`.
ResourceVariable y
Keras tensor or variable with `ndim >= 2`.
IEnumerable<int> axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_dot(IGraphNodeBase x, ResourceVariable y, int axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IGraphNodeBase x
Keras tensor or variable with `ndim >= 2`.
ResourceVariable y
Keras tensor or variable with `ndim >= 2`.
int axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_dot(IGraphNodeBase x, IGraphNodeBase y, int axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IGraphNodeBase x
Keras tensor or variable with `ndim >= 2`.
IGraphNodeBase y
Keras tensor or variable with `ndim >= 2`.
int axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_dot(IEnumerable<object> x, ReplicatedVariable y, IEnumerable<int> axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IEnumerable<object> x
Keras tensor or variable with `ndim >= 2`.
ReplicatedVariable y
Keras tensor or variable with `ndim >= 2`.
IEnumerable<int> axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_dot(IEnumerable<object> x, IEnumerable<object> y, IEnumerable<int> axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IEnumerable<object> x
Keras tensor or variable with `ndim >= 2`.
IEnumerable<object> y
Keras tensor or variable with `ndim >= 2`.
IEnumerable<int> axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_dot(IEnumerable<object> x, IEnumerable<object> y, int axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IEnumerable<object> x
Keras tensor or variable with `ndim >= 2`.
IEnumerable<object> y
Keras tensor or variable with `ndim >= 2`.
int axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_dot(IGraphNodeBase x, IEnumerable<object> y, IEnumerable<int> axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IGraphNodeBase x
Keras tensor or variable with `ndim >= 2`.
IEnumerable<object> y
Keras tensor or variable with `ndim >= 2`.
IEnumerable<int> axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_dot(IEnumerable<object> x, IGraphNodeBase y, IEnumerable<int> axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IEnumerable<object> x
Keras tensor or variable with `ndim >= 2`.
IGraphNodeBase y
Keras tensor or variable with `ndim >= 2`.
IEnumerable<int> axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_dot(IEnumerable<object> x, ResourceVariable y, int axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IEnumerable<object> x
Keras tensor or variable with `ndim >= 2`.
ResourceVariable y
Keras tensor or variable with `ndim >= 2`.
int axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_dot(IEnumerable<object> x, ResourceVariable y, IEnumerable<int> axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IEnumerable<object> x
Keras tensor or variable with `ndim >= 2`.
ResourceVariable y
Keras tensor or variable with `ndim >= 2`.
IEnumerable<int> axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_dot(IGraphNodeBase x, IGraphNodeBase y, IEnumerable<int> axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IGraphNodeBase x
Keras tensor or variable with `ndim >= 2`.
IGraphNodeBase y
Keras tensor or variable with `ndim >= 2`.
IEnumerable<int> axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_dot(IEnumerable<object> x, ReplicatedVariable y, int axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IEnumerable<object> x
Keras tensor or variable with `ndim >= 2`.
ReplicatedVariable y
Keras tensor or variable with `ndim >= 2`.
int axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_dot(IEnumerable<object> x, IGraphNodeBase y, int axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
IEnumerable<object> x
Keras tensor or variable with `ndim >= 2`.
IGraphNodeBase y
Keras tensor or variable with `ndim >= 2`.
int axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
Tensor
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

object batch_dot_dyn(object x, object y, object axes)

Batchwise dot product.

`batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of `(batch_size, :)`. `batch_dot` results in a tensor or variable with less dimensions than the input. If the number of dimensions is reduced to 1, we use `expand_dims` to make sure that ndim is at least 2.
Parameters
object x
Keras tensor or variable with `ndim >= 2`.
object y
Keras tensor or variable with `ndim >= 2`.
object axes
list of (or single) int with target dimensions. The lengths of `axes[0]` and `axes[1]` should be the same.
Returns
object
A tensor with shape equal to the concatenation of `x`'s shape (less the dimension that was summed over) and `y`'s shape (less the batch dimension and the dimension that was summed over). If the final rank is 1, we reshape it to `(batch_size, 1)`.

Examples: Assume `x = [[1, 2], [3, 4]]` and `y = [[5, 6], [7, 8]]` `batch_dot(x, y, axes=1) = [[17, 53]]` which is the main diagonal of `x.dot(y.T)`, although we never have to calculate the off-diagonal elements.

Shape inference: Let `x`'s shape be `(100, 20)` and `y`'s shape be `(100, 30, 20)`. If `axes` is (1, 2), to find the output shape of resultant tensor, loop through each dimension in `x`'s shape and `y`'s shape:

* `x.shape[0]` : 100 : append to output shape * `x.shape[1]` : 20 : do not append to output shape, dimension 1 of `x` has been summed over. (`dot_axes[0]` = 1) * `y.shape[0]` : 100 : do not append to output shape, always ignore first dimension of `y` * `y.shape[1]` : 30 : append to output shape * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`

```python >>> x_batch = K.ones(shape=(32, 20, 1)) >>> y_batch = K.ones(shape=(32, 30, 20)) >>> xy_batch_dot = K.batch_dot(x_batch, y_batch, axes=[1, 2]) >>> K.int_shape(xy_batch_dot) (32, 1, 30) ```

Tensor batch_flatten(IGraphNodeBase x)

Turn a nD tensor into a 2D tensor with same 0th dimension.

In other words, it flattens each data samples of a batch.
Parameters
IGraphNodeBase x
A tensor or variable.
Returns
Tensor
A tensor.

Examples: Flattening a 3D tensor to 2D by collapsing the last dimension.

```python >>> from tensorflow.keras import backend as K >>> x_batch = K.ones(shape=(2, 3, 4, 5)) >>> x_batch_flatten = K.batch_flatten(x_batch) >>> K.int_shape(x_batch_flatten) (2, 60) ```

object batch_flatten_dyn(object x)

Turn a nD tensor into a 2D tensor with same 0th dimension.

In other words, it flattens each data samples of a batch.
Parameters
object x
A tensor or variable.
Returns
object
A tensor.

Examples: Flattening a 3D tensor to 2D by collapsing the last dimension.

```python >>> from tensorflow.keras import backend as K >>> x_batch = K.ones(shape=(2, 3, 4, 5)) >>> x_batch_flatten = K.batch_flatten(x_batch) >>> K.int_shape(x_batch_flatten) (2, 60) ```

object batch_get_value(IEnumerable<object> tensors)

Returns the value of more than one tensor variable.
Parameters
IEnumerable<object> tensors
list of ops to run.
Returns
object
A list of Numpy arrays.

object batch_get_value_dyn(object tensors)

Returns the value of more than one tensor variable.
Parameters
object tensors
list of ops to run.
Returns
object
A list of Numpy arrays.

object batch_normalization(IGraphNodeBase x, IGraphNodeBase mean, IGraphNodeBase var, IGraphNodeBase beta, IGraphNodeBase gamma, int axis, double epsilon)

Applies batch normalization on x given mean, var, beta and gamma.

I.e. returns: `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`
Parameters
IGraphNodeBase x
Input tensor or variable.
IGraphNodeBase mean
Mean of batch.
IGraphNodeBase var
Variance of batch.
IGraphNodeBase beta
Tensor with which to center the input.
IGraphNodeBase gamma
Tensor by which to scale the input.
int axis
Integer, the axis that should be normalized. (typically the features axis).
double epsilon
Fuzz factor.
Returns
object
A tensor.

object batch_normalization(IGraphNodeBase x, IGraphNodeBase mean, IndexedSlices var, IGraphNodeBase beta, IGraphNodeBase gamma, int axis, double epsilon)

Applies batch normalization on x given mean, var, beta and gamma.

I.e. returns: `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`
Parameters
IGraphNodeBase x
Input tensor or variable.
IGraphNodeBase mean
Mean of batch.
IndexedSlices var
Variance of batch.
IGraphNodeBase beta
Tensor with which to center the input.
IGraphNodeBase gamma
Tensor by which to scale the input.
int axis
Integer, the axis that should be normalized. (typically the features axis).
double epsilon
Fuzz factor.
Returns
object
A tensor.

object batch_normalization(IGraphNodeBase x, IGraphNodeBase mean, ValueTuple<PythonClassContainer, PythonClassContainer> var, IGraphNodeBase beta, IGraphNodeBase gamma, int axis, double epsilon)

Applies batch normalization on x given mean, var, beta and gamma.

I.e. returns: `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`
Parameters
IGraphNodeBase x
Input tensor or variable.
IGraphNodeBase mean
Mean of batch.
ValueTuple<PythonClassContainer, PythonClassContainer> var
Variance of batch.
IGraphNodeBase beta
Tensor with which to center the input.
IGraphNodeBase gamma
Tensor by which to scale the input.
int axis
Integer, the axis that should be normalized. (typically the features axis).
double epsilon
Fuzz factor.
Returns
object
A tensor.

object batch_normalization(IGraphNodeBase x, IndexedSlices mean, IGraphNodeBase var, IGraphNodeBase beta, IGraphNodeBase gamma, int axis, double epsilon)

Applies batch normalization on x given mean, var, beta and gamma.

I.e. returns: `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`
Parameters
IGraphNodeBase x
Input tensor or variable.
IndexedSlices mean
Mean of batch.
IGraphNodeBase var
Variance of batch.
IGraphNodeBase beta
Tensor with which to center the input.
IGraphNodeBase gamma
Tensor by which to scale the input.
int axis
Integer, the axis that should be normalized. (typically the features axis).
double epsilon
Fuzz factor.
Returns
object
A tensor.

object batch_normalization(IGraphNodeBase x, IndexedSlices mean, IndexedSlices var, IGraphNodeBase beta, IGraphNodeBase gamma, int axis, double epsilon)

Applies batch normalization on x given mean, var, beta and gamma.

I.e. returns: `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`
Parameters
IGraphNodeBase x
Input tensor or variable.
IndexedSlices mean
Mean of batch.
IndexedSlices var
Variance of batch.
IGraphNodeBase beta
Tensor with which to center the input.
IGraphNodeBase gamma
Tensor by which to scale the input.
int axis
Integer, the axis that should be normalized. (typically the features axis).
double epsilon
Fuzz factor.
Returns
object
A tensor.

object batch_normalization(IGraphNodeBase x, ValueTuple<PythonClassContainer, PythonClassContainer> mean, IGraphNodeBase var, IGraphNodeBase beta, IGraphNodeBase gamma, int axis, double epsilon)

Applies batch normalization on x given mean, var, beta and gamma.

I.e. returns: `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`
Parameters
IGraphNodeBase x
Input tensor or variable.
ValueTuple<PythonClassContainer, PythonClassContainer> mean
Mean of batch.
IGraphNodeBase var
Variance of batch.
IGraphNodeBase beta
Tensor with which to center the input.
IGraphNodeBase gamma
Tensor by which to scale the input.
int axis
Integer, the axis that should be normalized. (typically the features axis).
double epsilon
Fuzz factor.
Returns
object
A tensor.

object batch_normalization(IGraphNodeBase x, ValueTuple<PythonClassContainer, PythonClassContainer> mean, IndexedSlices var, IGraphNodeBase beta, IGraphNodeBase gamma, int axis, double epsilon)

Applies batch normalization on x given mean, var, beta and gamma.

I.e. returns: `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`
Parameters
IGraphNodeBase x
Input tensor or variable.
ValueTuple<PythonClassContainer, PythonClassContainer> mean
Mean of batch.
IndexedSlices var
Variance of batch.
IGraphNodeBase beta
Tensor with which to center the input.
IGraphNodeBase gamma
Tensor by which to scale the input.
int axis
Integer, the axis that should be normalized. (typically the features axis).
double epsilon
Fuzz factor.
Returns
object
A tensor.

object batch_normalization(IGraphNodeBase x, ValueTuple<PythonClassContainer, PythonClassContainer> mean, ValueTuple<PythonClassContainer, PythonClassContainer> var, IGraphNodeBase beta, IGraphNodeBase gamma, int axis, double epsilon)

Applies batch normalization on x given mean, var, beta and gamma.

I.e. returns: `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`
Parameters
IGraphNodeBase x
Input tensor or variable.
ValueTuple<PythonClassContainer, PythonClassContainer> mean
Mean of batch.
ValueTuple<PythonClassContainer, PythonClassContainer> var
Variance of batch.
IGraphNodeBase beta
Tensor with which to center the input.
IGraphNodeBase gamma
Tensor by which to scale the input.
int axis
Integer, the axis that should be normalized. (typically the features axis).
double epsilon
Fuzz factor.
Returns
object
A tensor.

object batch_normalization(IGraphNodeBase x, IndexedSlices mean, ValueTuple<PythonClassContainer, PythonClassContainer> var, IGraphNodeBase beta, IGraphNodeBase gamma, int axis, double epsilon)

Applies batch normalization on x given mean, var, beta and gamma.

I.e. returns: `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`
Parameters
IGraphNodeBase x
Input tensor or variable.
IndexedSlices mean
Mean of batch.
ValueTuple<PythonClassContainer, PythonClassContainer> var
Variance of batch.
IGraphNodeBase beta
Tensor with which to center the input.
IGraphNodeBase gamma
Tensor by which to scale the input.
int axis
Integer, the axis that should be normalized. (typically the features axis).
double epsilon
Fuzz factor.
Returns
object
A tensor.

object batch_normalization_dyn(object x, object mean, object var, object beta, object gamma, ImplicitContainer<T> axis, ImplicitContainer<T> epsilon)

Applies batch normalization on x given mean, var, beta and gamma.

I.e. returns: `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta`
Parameters
object x
Input tensor or variable.
object mean
Mean of batch.
object var
Variance of batch.
object beta
Tensor with which to center the input.
object gamma
Tensor by which to scale the input.
ImplicitContainer<T> axis
Integer, the axis that should be normalized. (typically the features axis).
ImplicitContainer<T> epsilon
Fuzz factor.
Returns
object
A tensor.

void batch_set_value(IEnumerable<ValueTuple<object, object>> tuples)

Sets the values of many tensor variables at once.
Parameters
IEnumerable<ValueTuple<object, object>> tuples
a list of tuples `(tensor, value)`. `value` should be a Numpy array.

object batch_set_value_dyn(object tuples)

Sets the values of many tensor variables at once.
Parameters
object tuples
a list of tuples `(tensor, value)`. `value` should be a Numpy array.

object bias_add(IEnumerable<IGraphNodeBase> x, IGraphNodeBase bias, string data_format)

Adds a bias vector to a tensor.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
IGraphNodeBase bias
Bias tensor to add.
string data_format
string, `"channels_last"` or `"channels_first"`.
Returns
object
Output tensor.

object bias_add(IGraphNodeBase x, IGraphNodeBase bias, string data_format)

Adds a bias vector to a tensor.
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase bias
Bias tensor to add.
string data_format
string, `"channels_last"` or `"channels_first"`.
Returns
object
Output tensor.

object bias_add_dyn(object x, object bias, object data_format)

Adds a bias vector to a tensor.
Parameters
object x
Tensor or variable.
object bias
Bias tensor to add.
object data_format
string, `"channels_last"` or `"channels_first"`.
Returns
object
Output tensor.

Tensor binary_crossentropy(IndexedSlices target, IGraphNodeBase output, bool from_logits)

Binary crossentropy between an output tensor and a target tensor.
Parameters
IndexedSlices target
A tensor with the same shape as `output`.
IGraphNodeBase output
A tensor.
bool from_logits
Whether `output` is expected to be a logits tensor. By default, we consider that `output` encodes a probability distribution.
Returns
Tensor
A tensor.

Tensor binary_crossentropy(IGraphNodeBase target, IEnumerable<IGraphNodeBase> output, bool from_logits)

Binary crossentropy between an output tensor and a target tensor.
Parameters
IGraphNodeBase target
A tensor with the same shape as `output`.
IEnumerable<IGraphNodeBase> output
A tensor.
bool from_logits
Whether `output` is expected to be a logits tensor. By default, we consider that `output` encodes a probability distribution.
Returns
Tensor
A tensor.

Tensor binary_crossentropy(ValueTuple<PythonClassContainer, PythonClassContainer> target, IGraphNodeBase output, bool from_logits)

Binary crossentropy between an output tensor and a target tensor.
Parameters
ValueTuple<PythonClassContainer, PythonClassContainer> target
A tensor with the same shape as `output`.
IGraphNodeBase output
A tensor.
bool from_logits
Whether `output` is expected to be a logits tensor. By default, we consider that `output` encodes a probability distribution.
Returns
Tensor
A tensor.

Tensor binary_crossentropy(ValueTuple<PythonClassContainer, PythonClassContainer> target, IEnumerable<IGraphNodeBase> output, bool from_logits)

Binary crossentropy between an output tensor and a target tensor.
Parameters
ValueTuple<PythonClassContainer, PythonClassContainer> target
A tensor with the same shape as `output`.
IEnumerable<IGraphNodeBase> output
A tensor.
bool from_logits
Whether `output` is expected to be a logits tensor. By default, we consider that `output` encodes a probability distribution.
Returns
Tensor
A tensor.

Tensor binary_crossentropy(object target, IEnumerable<IGraphNodeBase> output, bool from_logits)

Binary crossentropy between an output tensor and a target tensor.
Parameters
object target
A tensor with the same shape as `output`.
IEnumerable<IGraphNodeBase> output
A tensor.
bool from_logits
Whether `output` is expected to be a logits tensor. By default, we consider that `output` encodes a probability distribution.
Returns
Tensor
A tensor.

Tensor binary_crossentropy(IEnumerable<object> target, IGraphNodeBase output, bool from_logits)

Binary crossentropy between an output tensor and a target tensor.
Parameters
IEnumerable<object> target
A tensor with the same shape as `output`.
IGraphNodeBase output
A tensor.
bool from_logits
Whether `output` is expected to be a logits tensor. By default, we consider that `output` encodes a probability distribution.
Returns
Tensor
A tensor.

Tensor binary_crossentropy(object target, IGraphNodeBase output, bool from_logits)

Binary crossentropy between an output tensor and a target tensor.
Parameters
object target
A tensor with the same shape as `output`.
IGraphNodeBase output
A tensor.
bool from_logits
Whether `output` is expected to be a logits tensor. By default, we consider that `output` encodes a probability distribution.
Returns
Tensor
A tensor.

Tensor binary_crossentropy(IGraphNodeBase target, IGraphNodeBase output, bool from_logits)

Binary crossentropy between an output tensor and a target tensor.
Parameters
IGraphNodeBase target
A tensor with the same shape as `output`.
IGraphNodeBase output
A tensor.
bool from_logits
Whether `output` is expected to be a logits tensor. By default, we consider that `output` encodes a probability distribution.
Returns
Tensor
A tensor.

Tensor binary_crossentropy(IEnumerable<object> target, IEnumerable<IGraphNodeBase> output, bool from_logits)

Binary crossentropy between an output tensor and a target tensor.
Parameters
IEnumerable<object> target
A tensor with the same shape as `output`.
IEnumerable<IGraphNodeBase> output
A tensor.
bool from_logits
Whether `output` is expected to be a logits tensor. By default, we consider that `output` encodes a probability distribution.
Returns
Tensor
A tensor.

Tensor binary_crossentropy(IndexedSlices target, IEnumerable<IGraphNodeBase> output, bool from_logits)

Binary crossentropy between an output tensor and a target tensor.
Parameters
IndexedSlices target
A tensor with the same shape as `output`.
IEnumerable<IGraphNodeBase> output
A tensor.
bool from_logits
Whether `output` is expected to be a logits tensor. By default, we consider that `output` encodes a probability distribution.
Returns
Tensor
A tensor.

object binary_crossentropy_dyn(object target, object output, ImplicitContainer<T> from_logits)

Binary crossentropy between an output tensor and a target tensor.
Parameters
object target
A tensor with the same shape as `output`.
object output
A tensor.
ImplicitContainer<T> from_logits
Whether `output` is expected to be a logits tensor. By default, we consider that `output` encodes a probability distribution.
Returns
object
A tensor.

object cast(IGraphNodeBase x, DType dtype)

Casts a tensor to a different dtype and returns it.

You can cast a Keras variable but it still returns a Keras tensor.
Parameters
IGraphNodeBase x
Keras tensor (or variable).
DType dtype
String, either (`'float16'`, `'float32'`, or `'float64'`).
Returns
object
Keras tensor with dtype `dtype`.

Examples: Cast a float32 variable to a float64 tensor

```python >>> import tensorflow as tf >>> from tensorflow.keras import backend as K >>> input = K.ones(shape=(1,3)) >>> print(input) >>> cast_input = K.cast(input, dtype='float64') >>> print(cast_input)

tf.Tensor([[1. 1. 1.]], shape=(1, 3), dtype=float64) ```

object cast(ValueTuple<PythonClassContainer, PythonClassContainer> x, DType dtype)

Casts a tensor to a different dtype and returns it.

You can cast a Keras variable but it still returns a Keras tensor.
Parameters
ValueTuple<PythonClassContainer, PythonClassContainer> x
Keras tensor (or variable).
DType dtype
String, either (`'float16'`, `'float32'`, or `'float64'`).
Returns
object
Keras tensor with dtype `dtype`.

Examples: Cast a float32 variable to a float64 tensor

```python >>> import tensorflow as tf >>> from tensorflow.keras import backend as K >>> input = K.ones(shape=(1,3)) >>> print(input) >>> cast_input = K.cast(input, dtype='float64') >>> print(cast_input)

tf.Tensor([[1. 1. 1.]], shape=(1, 3), dtype=float64) ```

object cast_dyn(object x, object dtype)

Casts a tensor to a different dtype and returns it.

You can cast a Keras variable but it still returns a Keras tensor.
Parameters
object x
Keras tensor (or variable).
object dtype
String, either (`'float16'`, `'float32'`, or `'float64'`).
Returns
object
Keras tensor with dtype `dtype`.

Examples: Cast a float32 variable to a float64 tensor

```python >>> import tensorflow as tf >>> from tensorflow.keras import backend as K >>> input = K.ones(shape=(1,3)) >>> print(input) >>> cast_input = K.cast(input, dtype='float64') >>> print(cast_input)

tf.Tensor([[1. 1. 1.]], shape=(1, 3), dtype=float64) ```

ndarray cast_to_floatx(int x)

Cast a Numpy array to the default Keras float type.
Parameters
int x
Numpy array.
Returns
ndarray
The same Numpy array, cast to its new type.

Example: ```python >>> from tensorflow.keras import backend as K >>> K.floatx() 'float32' >>> arr = numpy.array([1.0, 2.0], dtype='float64') >>> arr.dtype dtype('float64') >>> new_arr = K.cast_to_floatx(arr) >>> new_arr array([ 1., 2.], dtype=float32) >>> new_arr.dtype dtype('float32') ```

ndarray cast_to_floatx(ndarray x)

Cast a Numpy array to the default Keras float type.
Parameters
ndarray x
Numpy array.
Returns
ndarray
The same Numpy array, cast to its new type.

Example: ```python >>> from tensorflow.keras import backend as K >>> K.floatx() 'float32' >>> arr = numpy.array([1.0, 2.0], dtype='float64') >>> arr.dtype dtype('float64') >>> new_arr = K.cast_to_floatx(arr) >>> new_arr array([ 1., 2.], dtype=float32) >>> new_arr.dtype dtype('float32') ```

ndarray cast_to_floatx(double x)

Cast a Numpy array to the default Keras float type.
Parameters
double x
Numpy array.
Returns
ndarray
The same Numpy array, cast to its new type.

Example: ```python >>> from tensorflow.keras import backend as K >>> K.floatx() 'float32' >>> arr = numpy.array([1.0, 2.0], dtype='float64') >>> arr.dtype dtype('float64') >>> new_arr = K.cast_to_floatx(arr) >>> new_arr array([ 1., 2.], dtype=float32) >>> new_arr.dtype dtype('float32') ```

object cast_to_floatx_dyn(object x)

Cast a Numpy array to the default Keras float type.
Parameters
object x
Numpy array.
Returns
object
The same Numpy array, cast to its new type.

Example: ```python >>> from tensorflow.keras import backend as K >>> K.floatx() 'float32' >>> arr = numpy.array([1.0, 2.0], dtype='float64') >>> arr.dtype dtype('float64') >>> new_arr = K.cast_to_floatx(arr) >>> new_arr array([ 1., 2.], dtype=float32) >>> new_arr.dtype dtype('float32') ```

Tensor categorical_crossentropy(IEnumerable<object> target, IGraphNodeBase output, bool from_logits, int axis)

Computes the categorical crossentropy loss.
Parameters
IEnumerable<object> target
IGraphNodeBase output
bool from_logits
Whether `y_pred` is expected to be a logits tensor. By default, we assume that `y_pred` encodes a probability distribution.
int axis
Returns
Tensor
Categorical crossentropy loss value.

Tensor categorical_crossentropy(ValueTuple<PythonClassContainer, PythonClassContainer> target, IGraphNodeBase output, bool from_logits, int axis)

Computes the categorical crossentropy loss.
Parameters
ValueTuple<PythonClassContainer, PythonClassContainer> target
IGraphNodeBase output
bool from_logits
Whether `y_pred` is expected to be a logits tensor. By default, we assume that `y_pred` encodes a probability distribution.
int axis
Returns
Tensor
Categorical crossentropy loss value.

Tensor categorical_crossentropy(IndexedSlices target, IGraphNodeBase output, bool from_logits, int axis)

Computes the categorical crossentropy loss.
Parameters
IndexedSlices target
IGraphNodeBase output
bool from_logits
Whether `y_pred` is expected to be a logits tensor. By default, we assume that `y_pred` encodes a probability distribution.
int axis
Returns
Tensor
Categorical crossentropy loss value.

Tensor categorical_crossentropy(object target, IGraphNodeBase output, bool from_logits, int axis)

Computes the categorical crossentropy loss.
Parameters
object target
IGraphNodeBase output
bool from_logits
Whether `y_pred` is expected to be a logits tensor. By default, we assume that `y_pred` encodes a probability distribution.
int axis
Returns
Tensor
Categorical crossentropy loss value.

Tensor categorical_crossentropy(IGraphNodeBase target, IGraphNodeBase output, bool from_logits, int axis)

Computes the categorical crossentropy loss.
Parameters
IGraphNodeBase target
IGraphNodeBase output
bool from_logits
Whether `y_pred` is expected to be a logits tensor. By default, we assume that `y_pred` encodes a probability distribution.
int axis
Returns
Tensor
Categorical crossentropy loss value.

object categorical_crossentropy_dyn(object target, object output, ImplicitContainer<T> from_logits, ImplicitContainer<T> axis)

Computes the categorical crossentropy loss.
Parameters
object target
object output
ImplicitContainer<T> from_logits
Whether `y_pred` is expected to be a logits tensor. By default, we assume that `y_pred` encodes a probability distribution.
ImplicitContainer<T> axis
Returns
object
Categorical crossentropy loss value.

void clear_session()

Destroys the current TF graph and creates a new one.

Useful to avoid clutter from old models / layers.

object clear_session_dyn()

Destroys the current TF graph and creates a new one.

Useful to avoid clutter from old models / layers.

IndexedSlices clip(ValueTuple<PythonClassContainer, PythonClassContainer> x, double min_value, double max_value)

Element-wise value clipping.
Parameters
ValueTuple<PythonClassContainer, PythonClassContainer> x
Tensor or variable.
double min_value
Python float or integer.
double max_value
Python float or integer.
Returns
IndexedSlices
A tensor.

IndexedSlices clip(IGraphNodeBase x, int min_value, Nullable<int> max_value)

Element-wise value clipping.
Parameters
IGraphNodeBase x
Tensor or variable.
int min_value
Python float or integer.
Nullable<int> max_value
Python float or integer.
Returns
IndexedSlices
A tensor.

IndexedSlices clip(IGraphNodeBase x, double min_value, double max_value)

Element-wise value clipping.
Parameters
IGraphNodeBase x
Tensor or variable.
double min_value
Python float or integer.
double max_value
Python float or integer.
Returns
IndexedSlices
A tensor.

IndexedSlices clip(IndexedSlices x, int min_value, Nullable<int> max_value)

Element-wise value clipping.
Parameters
IndexedSlices x
Tensor or variable.
int min_value
Python float or integer.
Nullable<int> max_value
Python float or integer.
Returns
IndexedSlices
A tensor.

IndexedSlices clip(IGraphNodeBase x, int min_value, double max_value)

Element-wise value clipping.
Parameters
IGraphNodeBase x
Tensor or variable.
int min_value
Python float or integer.
double max_value
Python float or integer.
Returns
IndexedSlices
A tensor.

IndexedSlices clip(IndexedSlices x, int min_value, double max_value)

Element-wise value clipping.
Parameters
IndexedSlices x
Tensor or variable.
int min_value
Python float or integer.
double max_value
Python float or integer.
Returns
IndexedSlices
A tensor.

IndexedSlices clip(IndexedSlices x, double min_value, Nullable<int> max_value)

Element-wise value clipping.
Parameters
IndexedSlices x
Tensor or variable.
double min_value
Python float or integer.
Nullable<int> max_value
Python float or integer.
Returns
IndexedSlices
A tensor.

IndexedSlices clip(IndexedSlices x, double min_value, double max_value)

Element-wise value clipping.
Parameters
IndexedSlices x
Tensor or variable.
double min_value
Python float or integer.
double max_value
Python float or integer.
Returns
IndexedSlices
A tensor.

IndexedSlices clip(ValueTuple<PythonClassContainer, PythonClassContainer> x, int min_value, Nullable<int> max_value)

Element-wise value clipping.
Parameters
ValueTuple<PythonClassContainer, PythonClassContainer> x
Tensor or variable.
int min_value
Python float or integer.
Nullable<int> max_value
Python float or integer.
Returns
IndexedSlices
A tensor.

IndexedSlices clip(ValueTuple<PythonClassContainer, PythonClassContainer> x, int min_value, double max_value)

Element-wise value clipping.
Parameters
ValueTuple<PythonClassContainer, PythonClassContainer> x
Tensor or variable.
int min_value
Python float or integer.
double max_value
Python float or integer.
Returns
IndexedSlices
A tensor.

IndexedSlices clip(ValueTuple<PythonClassContainer, PythonClassContainer> x, double min_value, Nullable<int> max_value)

Element-wise value clipping.
Parameters
ValueTuple<PythonClassContainer, PythonClassContainer> x
Tensor or variable.
double min_value
Python float or integer.
Nullable<int> max_value
Python float or integer.
Returns
IndexedSlices
A tensor.

IndexedSlices clip(IGraphNodeBase x, double min_value, Nullable<int> max_value)

Element-wise value clipping.
Parameters
IGraphNodeBase x
Tensor or variable.
double min_value
Python float or integer.
Nullable<int> max_value
Python float or integer.
Returns
IndexedSlices
A tensor.

object clip_dyn(object x, object min_value, object max_value)

Element-wise value clipping.
Parameters
object x
Tensor or variable.
object min_value
Python float or integer.
object max_value
Python float or integer.
Returns
object
A tensor.

Tensor concatenate(IEnumerable<object> tensors, int axis)

Concatenates a list of tensors alongside the specified axis.
Parameters
IEnumerable<object> tensors
list of tensors to concatenate.
int axis
concatenation axis.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) >>> b = tf.constant([[10, 20, 30], [40, 50, 60], [70, 80, 90]]) >>> tf.keras.backend.concatenate((a, b), axis=-1) ```

Tensor concatenate(IGraphNodeBase tensors, int axis)

Concatenates a list of tensors alongside the specified axis.
Parameters
IGraphNodeBase tensors
list of tensors to concatenate.
int axis
concatenation axis.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) >>> b = tf.constant([[10, 20, 30], [40, 50, 60], [70, 80, 90]]) >>> tf.keras.backend.concatenate((a, b), axis=-1) ```

object concatenate_dyn(object tensors, ImplicitContainer<T> axis)

Concatenates a list of tensors alongside the specified axis.
Parameters
object tensors
list of tensors to concatenate.
ImplicitContainer<T> axis
concatenation axis.
Returns
object
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) >>> b = tf.constant([[10, 20, 30], [40, 50, 60], [70, 80, 90]]) >>> tf.keras.backend.concatenate((a, b), axis=-1) ```

Tensor constant(int value, string dtype, IEnumerable<int> shape, string name)

Creates a constant tensor.
Parameters
int value
A constant value (or list)
string dtype
The type of the elements of the resulting tensor.
IEnumerable<int> shape
Optional dimensions of resulting tensor.
string name
Optional name for the tensor.
Returns
Tensor
A Constant Tensor.

Tensor constant(double value, string dtype, IEnumerable<int> shape, string name)

Creates a constant tensor.
Parameters
double value
A constant value (or list)
string dtype
The type of the elements of the resulting tensor.
IEnumerable<int> shape
Optional dimensions of resulting tensor.
string name
Optional name for the tensor.
Returns
Tensor
A Constant Tensor.

Tensor constant(IEnumerable<object> value, string dtype, IEnumerable<int> shape, string name)

Creates a constant tensor.
Parameters
IEnumerable<object> value
A constant value (or list)
string dtype
The type of the elements of the resulting tensor.
IEnumerable<int> shape
Optional dimensions of resulting tensor.
string name
Optional name for the tensor.
Returns
Tensor
A Constant Tensor.

object conv1d(IGraphNodeBase x, IGraphNodeBase kernel, IEnumerable<int> strides, string padding, string data_format, int dilation_rate)

1D convolution.
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
IEnumerable<int> strides
stride integer.
string padding
string, `"same"`, `"causal"` or `"valid"`.
string data_format
string, one of "channels_last", "channels_first".
int dilation_rate
integer dilate rate.
Returns
object
A tensor, result of 1D convolution.

object conv1d(IGraphNodeBase x, IGraphNodeBase kernel, int strides, string padding, string data_format, int dilation_rate)

1D convolution.
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
int strides
stride integer.
string padding
string, `"same"`, `"causal"` or `"valid"`.
string data_format
string, one of "channels_last", "channels_first".
int dilation_rate
integer dilate rate.
Returns
object
A tensor, result of 1D convolution.

object conv1d_dyn(object x, object kernel, ImplicitContainer<T> strides, ImplicitContainer<T> padding, object data_format, ImplicitContainer<T> dilation_rate)

1D convolution.
Parameters
object x
Tensor or variable.
object kernel
kernel tensor.
ImplicitContainer<T> strides
stride integer.
ImplicitContainer<T> padding
string, `"same"`, `"causal"` or `"valid"`.
object data_format
string, one of "channels_last", "channels_first".
ImplicitContainer<T> dilation_rate
integer dilate rate.
Returns
object
A tensor, result of 1D convolution.

object conv2d(IGraphNodeBase x, IGraphNodeBase kernel, ValueTuple<int, object> strides, string padding, string data_format, ValueTuple<object> dilation_rate)

2D convolution.
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<int, object> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
`"channels_last"` or `"channels_first"`.
ValueTuple<object> dilation_rate
tuple of 2 integers.
Returns
object
A tensor, result of 2D convolution.

object conv2d(IGraphNodeBase x, IGraphNodeBase kernel, ValueTuple<int, object> strides, string padding, string data_format, ValueTuple<int, object> dilation_rate)

2D convolution.
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<int, object> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
`"channels_last"` or `"channels_first"`.
ValueTuple<int, object> dilation_rate
tuple of 2 integers.
Returns
object
A tensor, result of 2D convolution.

object conv2d(IGraphNodeBase x, IGraphNodeBase kernel, ValueTuple<object> strides, string padding, string data_format, ValueTuple<object> dilation_rate)

2D convolution.
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<object> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
`"channels_last"` or `"channels_first"`.
ValueTuple<object> dilation_rate
tuple of 2 integers.
Returns
object
A tensor, result of 2D convolution.

object conv2d(IGraphNodeBase x, IGraphNodeBase kernel, ValueTuple<object> strides, string padding, string data_format, ValueTuple<int, object> dilation_rate)

2D convolution.
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<object> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
`"channels_last"` or `"channels_first"`.
ValueTuple<int, object> dilation_rate
tuple of 2 integers.
Returns
object
A tensor, result of 2D convolution.

object conv2d_dyn(object x, object kernel, ImplicitContainer<T> strides, ImplicitContainer<T> padding, object data_format, ImplicitContainer<T> dilation_rate)

2D convolution.
Parameters
object x
Tensor or variable.
object kernel
kernel tensor.
ImplicitContainer<T> strides
strides tuple.
ImplicitContainer<T> padding
string, `"same"` or `"valid"`.
object data_format
`"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
tuple of 2 integers.
Returns
object
A tensor, result of 2D convolution.

object conv2d_transpose(IEnumerable<IGraphNodeBase> x, IGraphNodeBase kernel, ValueTuple<int> output_shape, ImplicitContainer<T> strides, string padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<int> output_shape
1D int tensor for the output shape.
ImplicitContainer<T> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IEnumerable<IGraphNodeBase> x, IGraphNodeBase kernel, ValueTuple<object, IEnumerable<object>> output_shape, ValueTuple<int, object> strides, ValueTuple<IEnumerable<object>, object> padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<object, IEnumerable<object>> output_shape
1D int tensor for the output shape.
ValueTuple<int, object> strides
strides tuple.
ValueTuple<IEnumerable<object>, object> padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IEnumerable<IGraphNodeBase> x, IGraphNodeBase kernel, ValueTuple<object, IEnumerable<object>> output_shape, ValueTuple<int, object> strides, string padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<object, IEnumerable<object>> output_shape
1D int tensor for the output shape.
ValueTuple<int, object> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IEnumerable<IGraphNodeBase> x, IGraphNodeBase kernel, ValueTuple<object, IEnumerable<object>> output_shape, ImplicitContainer<T> strides, ValueTuple<IEnumerable<object>, object> padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<object, IEnumerable<object>> output_shape
1D int tensor for the output shape.
ImplicitContainer<T> strides
strides tuple.
ValueTuple<IEnumerable<object>, object> padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IEnumerable<IGraphNodeBase> x, IGraphNodeBase kernel, ValueTuple<object, IEnumerable<object>> output_shape, ImplicitContainer<T> strides, string padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<object, IEnumerable<object>> output_shape
1D int tensor for the output shape.
ImplicitContainer<T> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IGraphNodeBase x, IGraphNodeBase kernel, ValueTuple<int> output_shape, ImplicitContainer<T> strides, string padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<int> output_shape
1D int tensor for the output shape.
ImplicitContainer<T> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IEnumerable<IGraphNodeBase> x, IGraphNodeBase kernel, ValueTuple<int> output_shape, ValueTuple<int, object> strides, string padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<int> output_shape
1D int tensor for the output shape.
ValueTuple<int, object> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IEnumerable<IGraphNodeBase> x, IGraphNodeBase kernel, IGraphNodeBase output_shape, ValueTuple<int, object> strides, string padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
IGraphNodeBase output_shape
1D int tensor for the output shape.
ValueTuple<int, object> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IEnumerable<IGraphNodeBase> x, IGraphNodeBase kernel, IGraphNodeBase output_shape, ImplicitContainer<T> strides, ValueTuple<IEnumerable<object>, object> padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
IGraphNodeBase output_shape
1D int tensor for the output shape.
ImplicitContainer<T> strides
strides tuple.
ValueTuple<IEnumerable<object>, object> padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IEnumerable<IGraphNodeBase> x, IGraphNodeBase kernel, IGraphNodeBase output_shape, ImplicitContainer<T> strides, string padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
IGraphNodeBase output_shape
1D int tensor for the output shape.
ImplicitContainer<T> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IGraphNodeBase x, IGraphNodeBase kernel, ValueTuple<int> output_shape, ValueTuple<int, object> strides, ValueTuple<IEnumerable<object>, object> padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<int> output_shape
1D int tensor for the output shape.
ValueTuple<int, object> strides
strides tuple.
ValueTuple<IEnumerable<object>, object> padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IGraphNodeBase x, IGraphNodeBase kernel, ValueTuple<int> output_shape, ValueTuple<int, object> strides, string padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<int> output_shape
1D int tensor for the output shape.
ValueTuple<int, object> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IGraphNodeBase x, IGraphNodeBase kernel, ValueTuple<int> output_shape, ImplicitContainer<T> strides, ValueTuple<IEnumerable<object>, object> padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<int> output_shape
1D int tensor for the output shape.
ImplicitContainer<T> strides
strides tuple.
ValueTuple<IEnumerable<object>, object> padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IEnumerable<IGraphNodeBase> x, IGraphNodeBase kernel, ValueTuple<int> output_shape, ImplicitContainer<T> strides, ValueTuple<IEnumerable<object>, object> padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<int> output_shape
1D int tensor for the output shape.
ImplicitContainer<T> strides
strides tuple.
ValueTuple<IEnumerable<object>, object> padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IEnumerable<IGraphNodeBase> x, IGraphNodeBase kernel, IGraphNodeBase output_shape, ValueTuple<int, object> strides, ValueTuple<IEnumerable<object>, object> padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
IGraphNodeBase output_shape
1D int tensor for the output shape.
ValueTuple<int, object> strides
strides tuple.
ValueTuple<IEnumerable<object>, object> padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IEnumerable<IGraphNodeBase> x, IGraphNodeBase kernel, ValueTuple<int> output_shape, ValueTuple<int, object> strides, ValueTuple<IEnumerable<object>, object> padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<int> output_shape
1D int tensor for the output shape.
ValueTuple<int, object> strides
strides tuple.
ValueTuple<IEnumerable<object>, object> padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IGraphNodeBase x, IGraphNodeBase kernel, ValueTuple<object, IEnumerable<object>> output_shape, ValueTuple<int, object> strides, string padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<object, IEnumerable<object>> output_shape
1D int tensor for the output shape.
ValueTuple<int, object> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IGraphNodeBase x, IGraphNodeBase kernel, ValueTuple<object, IEnumerable<object>> output_shape, ImplicitContainer<T> strides, ValueTuple<IEnumerable<object>, object> padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<object, IEnumerable<object>> output_shape
1D int tensor for the output shape.
ImplicitContainer<T> strides
strides tuple.
ValueTuple<IEnumerable<object>, object> padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IGraphNodeBase x, IGraphNodeBase kernel, ValueTuple<object, IEnumerable<object>> output_shape, ImplicitContainer<T> strides, string padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<object, IEnumerable<object>> output_shape
1D int tensor for the output shape.
ImplicitContainer<T> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IGraphNodeBase x, IGraphNodeBase kernel, IGraphNodeBase output_shape, ImplicitContainer<T> strides, ValueTuple<IEnumerable<object>, object> padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
IGraphNodeBase output_shape
1D int tensor for the output shape.
ImplicitContainer<T> strides
strides tuple.
ValueTuple<IEnumerable<object>, object> padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IGraphNodeBase x, IGraphNodeBase kernel, IGraphNodeBase output_shape, ValueTuple<int, object> strides, ValueTuple<IEnumerable<object>, object> padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
IGraphNodeBase output_shape
1D int tensor for the output shape.
ValueTuple<int, object> strides
strides tuple.
ValueTuple<IEnumerable<object>, object> padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IGraphNodeBase x, IGraphNodeBase kernel, IGraphNodeBase output_shape, ValueTuple<int, object> strides, string padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
IGraphNodeBase output_shape
1D int tensor for the output shape.
ValueTuple<int, object> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IGraphNodeBase x, IGraphNodeBase kernel, ValueTuple<object, IEnumerable<object>> output_shape, ValueTuple<int, object> strides, ValueTuple<IEnumerable<object>, object> padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<object, IEnumerable<object>> output_shape
1D int tensor for the output shape.
ValueTuple<int, object> strides
strides tuple.
ValueTuple<IEnumerable<object>, object> padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose(IGraphNodeBase x, IGraphNodeBase kernel, IGraphNodeBase output_shape, ImplicitContainer<T> strides, string padding, string data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
IGraphNodeBase output_shape
1D int tensor for the output shape.
ImplicitContainer<T> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv2d_transpose_dyn(object x, object kernel, object output_shape, ImplicitContainer<T> strides, ImplicitContainer<T> padding, object data_format, ImplicitContainer<T> dilation_rate)

2D deconvolution (i.e.

transposed convolution).
Parameters
object x
Tensor or variable.
object kernel
kernel tensor.
object output_shape
1D int tensor for the output shape.
ImplicitContainer<T> strides
strides tuple.
ImplicitContainer<T> padding
string, `"same"` or `"valid"`.
object data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
Tuple of 2 integers.
Returns
object
A tensor, result of transposed 2D convolution.

object conv3d(IGraphNodeBase x, IGraphNodeBase kernel, ValueTuple<int, object, object> strides, string padding, string data_format, ValueTuple<int, object, object> dilation_rate)

3D convolution.
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase kernel
kernel tensor.
ValueTuple<int, object, object> strides
strides tuple.
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ValueTuple<int, object, object> dilation_rate
tuple of 3 integers.
Returns
object
A tensor, result of 3D convolution.

object conv3d_dyn(object x, object kernel, ImplicitContainer<T> strides, ImplicitContainer<T> padding, object data_format, ImplicitContainer<T> dilation_rate)

3D convolution.
Parameters
object x
Tensor or variable.
object kernel
kernel tensor.
ImplicitContainer<T> strides
strides tuple.
ImplicitContainer<T> padding
string, `"same"` or `"valid"`.
object data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
tuple of 3 integers.
Returns
object
A tensor, result of 3D convolution.

Tensor cos(object x)

Computes cos of x element-wise.
Parameters
object x
Tensor or variable.
Returns
Tensor
A tensor.

object cos_dyn(object x)

Computes cos of x element-wise.
Parameters
object x
Tensor or variable.
Returns
object
A tensor.

object count_params(IGraphNodeBase x)

Returns the static number of elements in a variable or tensor.
Parameters
IGraphNodeBase x
Variable or tensor.
Returns
object
Integer, the number of scalars in `x`.

Example: ```python >>> kvar = K.zeros((2,3)) >>> K.count_params(kvar) 6 >>> K.eval(kvar) array([[ 0., 0., 0.], [ 0., 0., 0.]], dtype=float32) ```

Tensor ctc_batch_cost(IGraphNodeBase y_true, IGraphNodeBase y_pred, IGraphNodeBase input_length, ndarray label_length)

Runs CTC loss algorithm on each batch element.
Parameters
IGraphNodeBase y_true
tensor `(samples, max_string_length)` containing the truth labels.
IGraphNodeBase y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
IGraphNodeBase input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
ndarray label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

Tensor ctc_batch_cost(IGraphNodeBase y_true, IGraphNodeBase y_pred, ndarray input_length, IGraphNodeBase label_length)

Runs CTC loss algorithm on each batch element.
Parameters
IGraphNodeBase y_true
tensor `(samples, max_string_length)` containing the truth labels.
IGraphNodeBase y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
ndarray input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
IGraphNodeBase label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

Tensor ctc_batch_cost(IGraphNodeBase y_true, IGraphNodeBase y_pred, ndarray input_length, ndarray label_length)

Runs CTC loss algorithm on each batch element.
Parameters
IGraphNodeBase y_true
tensor `(samples, max_string_length)` containing the truth labels.
IGraphNodeBase y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
ndarray input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
ndarray label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

Tensor ctc_batch_cost(IGraphNodeBase y_true, ndarray y_pred, IGraphNodeBase input_length, IGraphNodeBase label_length)

Runs CTC loss algorithm on each batch element.
Parameters
IGraphNodeBase y_true
tensor `(samples, max_string_length)` containing the truth labels.
ndarray y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
IGraphNodeBase input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
IGraphNodeBase label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

Tensor ctc_batch_cost(IGraphNodeBase y_true, ndarray y_pred, ndarray input_length, IGraphNodeBase label_length)

Runs CTC loss algorithm on each batch element.
Parameters
IGraphNodeBase y_true
tensor `(samples, max_string_length)` containing the truth labels.
ndarray y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
ndarray input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
IGraphNodeBase label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

Tensor ctc_batch_cost(IGraphNodeBase y_true, ndarray y_pred, ndarray input_length, ndarray label_length)

Runs CTC loss algorithm on each batch element.
Parameters
IGraphNodeBase y_true
tensor `(samples, max_string_length)` containing the truth labels.
ndarray y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
ndarray input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
ndarray label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

Tensor ctc_batch_cost(ndarray y_true, IGraphNodeBase y_pred, IGraphNodeBase input_length, IGraphNodeBase label_length)

Runs CTC loss algorithm on each batch element.
Parameters
ndarray y_true
tensor `(samples, max_string_length)` containing the truth labels.
IGraphNodeBase y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
IGraphNodeBase input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
IGraphNodeBase label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

Tensor ctc_batch_cost(ndarray y_true, IGraphNodeBase y_pred, IGraphNodeBase input_length, ndarray label_length)

Runs CTC loss algorithm on each batch element.
Parameters
ndarray y_true
tensor `(samples, max_string_length)` containing the truth labels.
IGraphNodeBase y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
IGraphNodeBase input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
ndarray label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

Tensor ctc_batch_cost(ndarray y_true, IGraphNodeBase y_pred, ndarray input_length, IGraphNodeBase label_length)

Runs CTC loss algorithm on each batch element.
Parameters
ndarray y_true
tensor `(samples, max_string_length)` containing the truth labels.
IGraphNodeBase y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
ndarray input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
IGraphNodeBase label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

Tensor ctc_batch_cost(ndarray y_true, IGraphNodeBase y_pred, ndarray input_length, ndarray label_length)

Runs CTC loss algorithm on each batch element.
Parameters
ndarray y_true
tensor `(samples, max_string_length)` containing the truth labels.
IGraphNodeBase y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
ndarray input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
ndarray label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

Tensor ctc_batch_cost(ndarray y_true, ndarray y_pred, IGraphNodeBase input_length, IGraphNodeBase label_length)

Runs CTC loss algorithm on each batch element.
Parameters
ndarray y_true
tensor `(samples, max_string_length)` containing the truth labels.
ndarray y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
IGraphNodeBase input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
IGraphNodeBase label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

Tensor ctc_batch_cost(ndarray y_true, ndarray y_pred, IGraphNodeBase input_length, ndarray label_length)

Runs CTC loss algorithm on each batch element.
Parameters
ndarray y_true
tensor `(samples, max_string_length)` containing the truth labels.
ndarray y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
IGraphNodeBase input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
ndarray label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

Tensor ctc_batch_cost(ndarray y_true, ndarray y_pred, ndarray input_length, IGraphNodeBase label_length)

Runs CTC loss algorithm on each batch element.
Parameters
ndarray y_true
tensor `(samples, max_string_length)` containing the truth labels.
ndarray y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
ndarray input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
IGraphNodeBase label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

Tensor ctc_batch_cost(IGraphNodeBase y_true, IGraphNodeBase y_pred, IGraphNodeBase input_length, IGraphNodeBase label_length)

Runs CTC loss algorithm on each batch element.
Parameters
IGraphNodeBase y_true
tensor `(samples, max_string_length)` containing the truth labels.
IGraphNodeBase y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
IGraphNodeBase input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
IGraphNodeBase label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

Tensor ctc_batch_cost(IGraphNodeBase y_true, ndarray y_pred, IGraphNodeBase input_length, ndarray label_length)

Runs CTC loss algorithm on each batch element.
Parameters
IGraphNodeBase y_true
tensor `(samples, max_string_length)` containing the truth labels.
ndarray y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
IGraphNodeBase input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
ndarray label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

Tensor ctc_batch_cost(ndarray y_true, ndarray y_pred, ndarray input_length, ndarray label_length)

Runs CTC loss algorithm on each batch element.
Parameters
ndarray y_true
tensor `(samples, max_string_length)` containing the truth labels.
ndarray y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
ndarray input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
ndarray label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
Tensor
Tensor with shape (samples,1) containing the CTC loss of each element.

object ctc_batch_cost_dyn(object y_true, object y_pred, object input_length, object label_length)

Runs CTC loss algorithm on each batch element.
Parameters
object y_true
tensor `(samples, max_string_length)` containing the truth labels.
object y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
object input_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_pred`.
object label_length
tensor `(samples, 1)` containing the sequence length for each batch item in `y_true`.
Returns
object
Tensor with shape (samples,1) containing the CTC loss of each element.

ValueTuple<IList<Tensor>, object> ctc_decode(IEnumerable<ndarray> y_pred, IGraphNodeBase input_length, bool greedy, int beam_width, int top_paths)

Decodes the output of a softmax.

Can use either greedy search (also known as best path) or a constrained dictionary search.
Parameters
IEnumerable<ndarray> y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
IGraphNodeBase input_length
tensor `(samples, )` containing the sequence length for each batch item in `y_pred`.
bool greedy
perform much faster best-path search if `true`. This does not use a dictionary.
int beam_width
if `greedy` is `false`: a beam search decoder will be used with a beam of this width.
int top_paths
if `greedy` is `false`, how many of the most probable paths will be returned.
Returns
ValueTuple<IList<Tensor>, object>

ValueTuple<IList<Tensor>, object> ctc_decode(IGraphNodeBase y_pred, IGraphNodeBase input_length, bool greedy, int beam_width, int top_paths)

Decodes the output of a softmax.

Can use either greedy search (also known as best path) or a constrained dictionary search.
Parameters
IGraphNodeBase y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
IGraphNodeBase input_length
tensor `(samples, )` containing the sequence length for each batch item in `y_pred`.
bool greedy
perform much faster best-path search if `true`. This does not use a dictionary.
int beam_width
if `greedy` is `false`: a beam search decoder will be used with a beam of this width.
int top_paths
if `greedy` is `false`, how many of the most probable paths will be returned.
Returns
ValueTuple<IList<Tensor>, object>

object ctc_decode_dyn(object y_pred, object input_length, ImplicitContainer<T> greedy, ImplicitContainer<T> beam_width, ImplicitContainer<T> top_paths)

Decodes the output of a softmax.

Can use either greedy search (also known as best path) or a constrained dictionary search.
Parameters
object y_pred
tensor `(samples, time_steps, num_categories)` containing the prediction, or output of the softmax.
object input_length
tensor `(samples, )` containing the sequence length for each batch item in `y_pred`.
ImplicitContainer<T> greedy
perform much faster best-path search if `true`. This does not use a dictionary.
ImplicitContainer<T> beam_width
if `greedy` is `false`: a beam search decoder will be used with a beam of this width.
ImplicitContainer<T> top_paths
if `greedy` is `false`, how many of the most probable paths will be returned.
Returns
object

SparseTensor ctc_label_dense_to_sparse(ndarray labels, ndarray label_lengths)

Converts CTC labels from dense to sparse.
Parameters
ndarray labels
dense CTC labels.
ndarray label_lengths
length of the labels.
Returns
SparseTensor
A sparse tensor representation of the labels.

SparseTensor ctc_label_dense_to_sparse(ndarray labels, IndexedSlices label_lengths)

Converts CTC labels from dense to sparse.
Parameters
ndarray labels
dense CTC labels.
IndexedSlices label_lengths
length of the labels.
Returns
SparseTensor
A sparse tensor representation of the labels.

SparseTensor ctc_label_dense_to_sparse(ndarray labels, ValueTuple<PythonClassContainer, PythonClassContainer> label_lengths)

Converts CTC labels from dense to sparse.
Parameters
ndarray labels
dense CTC labels.
ValueTuple<PythonClassContainer, PythonClassContainer> label_lengths
length of the labels.
Returns
SparseTensor
A sparse tensor representation of the labels.

SparseTensor ctc_label_dense_to_sparse(IGraphNodeBase labels, IGraphNodeBase label_lengths)

Converts CTC labels from dense to sparse.
Parameters
IGraphNodeBase labels
dense CTC labels.
IGraphNodeBase label_lengths
length of the labels.
Returns
SparseTensor
A sparse tensor representation of the labels.

SparseTensor ctc_label_dense_to_sparse(IGraphNodeBase labels, IndexedSlices label_lengths)

Converts CTC labels from dense to sparse.
Parameters
IGraphNodeBase labels
dense CTC labels.
IndexedSlices label_lengths
length of the labels.
Returns
SparseTensor
A sparse tensor representation of the labels.

SparseTensor ctc_label_dense_to_sparse(IGraphNodeBase labels, ValueTuple<PythonClassContainer, PythonClassContainer> label_lengths)

Converts CTC labels from dense to sparse.
Parameters
IGraphNodeBase labels
dense CTC labels.
ValueTuple<PythonClassContainer, PythonClassContainer> label_lengths
length of the labels.
Returns
SparseTensor
A sparse tensor representation of the labels.

SparseTensor ctc_label_dense_to_sparse(IGraphNodeBase labels, ndarray label_lengths)

Converts CTC labels from dense to sparse.
Parameters
IGraphNodeBase labels
dense CTC labels.
ndarray label_lengths
length of the labels.
Returns
SparseTensor
A sparse tensor representation of the labels.

SparseTensor ctc_label_dense_to_sparse(ndarray labels, IGraphNodeBase label_lengths)

Converts CTC labels from dense to sparse.
Parameters
ndarray labels
dense CTC labels.
IGraphNodeBase label_lengths
length of the labels.
Returns
SparseTensor
A sparse tensor representation of the labels.

object ctc_label_dense_to_sparse_dyn(object labels, object label_lengths)

Converts CTC labels from dense to sparse.
Parameters
object labels
dense CTC labels.
object label_lengths
length of the labels.
Returns
object
A sparse tensor representation of the labels.

Tensor cumprod(object x, int axis)

Cumulative product of the values in a tensor, alongside the specified axis.
Parameters
object x
A tensor or variable.
int axis
An integer, the axis to compute the product.
Returns
Tensor
A tensor of the cumulative product of values of `x` along `axis`.

object cumprod_dyn(object x, ImplicitContainer<T> axis)

Cumulative product of the values in a tensor, alongside the specified axis.
Parameters
object x
A tensor or variable.
ImplicitContainer<T> axis
An integer, the axis to compute the product.
Returns
object
A tensor of the cumulative product of values of `x` along `axis`.

Tensor cumsum(object x, int axis)

Cumulative sum of the values in a tensor, alongside the specified axis.
Parameters
object x
A tensor or variable.
int axis
An integer, the axis to compute the sum.
Returns
Tensor
A tensor of the cumulative sum of values of `x` along `axis`.

object cumsum_dyn(object x, ImplicitContainer<T> axis)

Cumulative sum of the values in a tensor, alongside the specified axis.
Parameters
object x
A tensor or variable.
ImplicitContainer<T> axis
An integer, the axis to compute the sum.
Returns
object
A tensor of the cumulative sum of values of `x` along `axis`.

Tensor dot(IEnumerable<IGraphNodeBase> x, ResourceVariable y)

Multiplies 2 tensors (and/or variables) and returns a *tensor*.

When attempting to multiply a nD tensor with a nD tensor, it reproduces the Theano behavior. (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`)
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
ResourceVariable y
Tensor or variable.
Returns
Tensor
A tensor, dot product of `x` and `y`.

Examples: ```python # dot product between tensors >>> x = K.placeholder(shape=(2, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # dot product between tensors >>> x = K.placeholder(shape=(32, 28, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # Theano-like behavior example >>> x = K.random_uniform_variable(shape=(2, 3), low=0, high=1) >>> y = K.ones((4, 3, 5)) >>> xy = K.dot(x, y) >>> K.int_shape(xy) (2, 4, 5) ```

Tensor dot(object x, IGraphNodeBase y)

Multiplies 2 tensors (and/or variables) and returns a *tensor*.

When attempting to multiply a nD tensor with a nD tensor, it reproduces the Theano behavior. (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`)
Parameters
object x
Tensor or variable.
IGraphNodeBase y
Tensor or variable.
Returns
Tensor
A tensor, dot product of `x` and `y`.

Examples: ```python # dot product between tensors >>> x = K.placeholder(shape=(2, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # dot product between tensors >>> x = K.placeholder(shape=(32, 28, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # Theano-like behavior example >>> x = K.random_uniform_variable(shape=(2, 3), low=0, high=1) >>> y = K.ones((4, 3, 5)) >>> xy = K.dot(x, y) >>> K.int_shape(xy) (2, 4, 5) ```

Tensor dot(IEnumerable<IGraphNodeBase> x, IGraphNodeBase y)

Multiplies 2 tensors (and/or variables) and returns a *tensor*.

When attempting to multiply a nD tensor with a nD tensor, it reproduces the Theano behavior. (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`)
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
IGraphNodeBase y
Tensor or variable.
Returns
Tensor
A tensor, dot product of `x` and `y`.

Examples: ```python # dot product between tensors >>> x = K.placeholder(shape=(2, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # dot product between tensors >>> x = K.placeholder(shape=(32, 28, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # Theano-like behavior example >>> x = K.random_uniform_variable(shape=(2, 3), low=0, high=1) >>> y = K.ones((4, 3, 5)) >>> xy = K.dot(x, y) >>> K.int_shape(xy) (2, 4, 5) ```

Tensor dot(PythonClassContainer x, ReplicatedVariable y)

Multiplies 2 tensors (and/or variables) and returns a *tensor*.

When attempting to multiply a nD tensor with a nD tensor, it reproduces the Theano behavior. (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`)
Parameters
PythonClassContainer x
Tensor or variable.
ReplicatedVariable y
Tensor or variable.
Returns
Tensor
A tensor, dot product of `x` and `y`.

Examples: ```python # dot product between tensors >>> x = K.placeholder(shape=(2, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # dot product between tensors >>> x = K.placeholder(shape=(32, 28, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # Theano-like behavior example >>> x = K.random_uniform_variable(shape=(2, 3), low=0, high=1) >>> y = K.ones((4, 3, 5)) >>> xy = K.dot(x, y) >>> K.int_shape(xy) (2, 4, 5) ```

Tensor dot(object x, ResourceVariable y)

Multiplies 2 tensors (and/or variables) and returns a *tensor*.

When attempting to multiply a nD tensor with a nD tensor, it reproduces the Theano behavior. (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`)
Parameters
object x
Tensor or variable.
ResourceVariable y
Tensor or variable.
Returns
Tensor
A tensor, dot product of `x` and `y`.

Examples: ```python # dot product between tensors >>> x = K.placeholder(shape=(2, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # dot product between tensors >>> x = K.placeholder(shape=(32, 28, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # Theano-like behavior example >>> x = K.random_uniform_variable(shape=(2, 3), low=0, high=1) >>> y = K.ones((4, 3, 5)) >>> xy = K.dot(x, y) >>> K.int_shape(xy) (2, 4, 5) ```

Tensor dot(PythonClassContainer x, IGraphNodeBase y)

Multiplies 2 tensors (and/or variables) and returns a *tensor*.

When attempting to multiply a nD tensor with a nD tensor, it reproduces the Theano behavior. (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`)
Parameters
PythonClassContainer x
Tensor or variable.
IGraphNodeBase y
Tensor or variable.
Returns
Tensor
A tensor, dot product of `x` and `y`.

Examples: ```python # dot product between tensors >>> x = K.placeholder(shape=(2, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # dot product between tensors >>> x = K.placeholder(shape=(32, 28, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # Theano-like behavior example >>> x = K.random_uniform_variable(shape=(2, 3), low=0, high=1) >>> y = K.ones((4, 3, 5)) >>> xy = K.dot(x, y) >>> K.int_shape(xy) (2, 4, 5) ```

Tensor dot(PythonClassContainer x, ResourceVariable y)

Multiplies 2 tensors (and/or variables) and returns a *tensor*.

When attempting to multiply a nD tensor with a nD tensor, it reproduces the Theano behavior. (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`)
Parameters
PythonClassContainer x
Tensor or variable.
ResourceVariable y
Tensor or variable.
Returns
Tensor
A tensor, dot product of `x` and `y`.

Examples: ```python # dot product between tensors >>> x = K.placeholder(shape=(2, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # dot product between tensors >>> x = K.placeholder(shape=(32, 28, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # Theano-like behavior example >>> x = K.random_uniform_variable(shape=(2, 3), low=0, high=1) >>> y = K.ones((4, 3, 5)) >>> xy = K.dot(x, y) >>> K.int_shape(xy) (2, 4, 5) ```

Tensor dot(IEnumerable<IGraphNodeBase> x, ReplicatedVariable y)

Multiplies 2 tensors (and/or variables) and returns a *tensor*.

When attempting to multiply a nD tensor with a nD tensor, it reproduces the Theano behavior. (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`)
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
ReplicatedVariable y
Tensor or variable.
Returns
Tensor
A tensor, dot product of `x` and `y`.

Examples: ```python # dot product between tensors >>> x = K.placeholder(shape=(2, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # dot product between tensors >>> x = K.placeholder(shape=(32, 28, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # Theano-like behavior example >>> x = K.random_uniform_variable(shape=(2, 3), low=0, high=1) >>> y = K.ones((4, 3, 5)) >>> xy = K.dot(x, y) >>> K.int_shape(xy) (2, 4, 5) ```

Tensor dot(object x, ReplicatedVariable y)

Multiplies 2 tensors (and/or variables) and returns a *tensor*.

When attempting to multiply a nD tensor with a nD tensor, it reproduces the Theano behavior. (e.g. `(2, 3) * (4, 3, 5) -> (2, 4, 5)`)
Parameters
object x
Tensor or variable.
ReplicatedVariable y
Tensor or variable.
Returns
Tensor
A tensor, dot product of `x` and `y`.

Examples: ```python # dot product between tensors >>> x = K.placeholder(shape=(2, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # dot product between tensors >>> x = K.placeholder(shape=(32, 28, 3)) >>> y = K.placeholder(shape=(3, 4)) >>> xy = K.dot(x, y) >>> xy ```

```python # Theano-like behavior example >>> x = K.random_uniform_variable(shape=(2, 3), low=0, high=1) >>> y = K.ones((4, 3, 5)) >>> xy = K.dot(x, y) >>> K.int_shape(xy) (2, 4, 5) ```

Tensor dropout(IGraphNodeBase x, double level, Nullable<ValueTuple<int, int>> noise_shape, object seed)

Sets entries in `x` to zero at random, while scaling the entire tensor.
Parameters
IGraphNodeBase x
tensor
double level
fraction of the entries in the tensor that will be set to 0.
Nullable<ValueTuple<int, int>> noise_shape
shape for randomly generated keep/drop flags, must be broadcastable to the shape of `x`
object seed
random seed to ensure determinism.
Returns
Tensor
A tensor.

object dropout_dyn(object x, object level, object noise_shape, object seed)

Sets entries in `x` to zero at random, while scaling the entire tensor.
Parameters
object x
tensor
object level
fraction of the entries in the tensor that will be set to 0.
object noise_shape
shape for randomly generated keep/drop flags, must be broadcastable to the shape of `x`
object seed
random seed to ensure determinism.
Returns
object
A tensor.

object dtype(IEnumerable<IGraphNodeBase> x)

Returns the dtype of a Keras tensor or variable, as a string.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
Returns
object
String, dtype of `x`.

Examples: ```python >>> from keras import backend as K >>> K.dtype(K.placeholder(shape=(2,4,5))) 'float32' >>> K.dtype(K.placeholder(shape=(2,4,5), dtype='float32')) 'float32' >>> K.dtype(K.placeholder(shape=(2,4,5), dtype='float64')) 'float64' # Keras variable >>> kvar = K.variable(np.array([[1, 2], [3, 4]])) >>> K.dtype(kvar) 'float32' >>> kvar = K.variable(np.array([[1, 2], [3, 4]]), dtype='float32') >>> K.dtype(kvar) 'float32' ```

object dtype(object x)

Returns the dtype of a Keras tensor or variable, as a string.
Parameters
object x
Tensor or variable.
Returns
object
String, dtype of `x`.

Examples: ```python >>> from keras import backend as K >>> K.dtype(K.placeholder(shape=(2,4,5))) 'float32' >>> K.dtype(K.placeholder(shape=(2,4,5), dtype='float32')) 'float32' >>> K.dtype(K.placeholder(shape=(2,4,5), dtype='float64')) 'float64' # Keras variable >>> kvar = K.variable(np.array([[1, 2], [3, 4]])) >>> K.dtype(kvar) 'float32' >>> kvar = K.variable(np.array([[1, 2], [3, 4]]), dtype='float32') >>> K.dtype(kvar) 'float32' ```

object dtype_dyn(object x)

Returns the dtype of a Keras tensor or variable, as a string.
Parameters
object x
Tensor or variable.
Returns
object
String, dtype of `x`.

Examples: ```python >>> from keras import backend as K >>> K.dtype(K.placeholder(shape=(2,4,5))) 'float32' >>> K.dtype(K.placeholder(shape=(2,4,5), dtype='float32')) 'float32' >>> K.dtype(K.placeholder(shape=(2,4,5), dtype='float64')) 'float64' # Keras variable >>> kvar = K.variable(np.array([[1, 2], [3, 4]])) >>> K.dtype(kvar) 'float32' >>> kvar = K.variable(np.array([[1, 2], [3, 4]]), dtype='float32') >>> K.dtype(kvar) 'float32' ```

Tensor elu(IGraphNodeBase x, ndarray alpha)

Exponential linear unit.
Parameters
IGraphNodeBase x
A tensor or variable to compute the activation function for.
ndarray alpha
A scalar, slope of negative section.
Returns
Tensor
A tensor.

Tensor elu(IEnumerable<IGraphNodeBase> x, double alpha)

Exponential linear unit.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable to compute the activation function for.
double alpha
A scalar, slope of negative section.
Returns
Tensor
A tensor.

Tensor elu(IEnumerable<IGraphNodeBase> x, ndarray alpha)

Exponential linear unit.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable to compute the activation function for.
ndarray alpha
A scalar, slope of negative section.
Returns
Tensor
A tensor.

double epsilon()

Returns the value of the fuzz factor used in numeric expressions.
Returns
double
A float.

Example: ```python keras.backend.epsilon() >>>1e-07 ```

object epsilon_dyn()

Returns the value of the fuzz factor used in numeric expressions.
Returns
object
A float.

Example: ```python keras.backend.epsilon() >>>1e-07 ```

Tensor equal(IGraphNodeBase x, IGraphNodeBase y)

Element-wise equality between two tensors.
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase y
Tensor or variable.
Returns
Tensor
A bool tensor.

object equal_dyn(object x, object y)

Element-wise equality between two tensors.
Parameters
object x
Tensor or variable.
object y
Tensor or variable.
Returns
object
A bool tensor.

object eval(PythonFunctionContainer x)

Evaluates the value of a variable.
Parameters
PythonFunctionContainer x
A variable.
Returns
object
A Numpy array.

Examples: ```python >>> from keras import backend as K >>> kvar = K.variable(np.array([[1, 2], [3, 4]]), dtype='float32') >>> K.eval(kvar) array([[ 1., 2.], [ 3., 4.]], dtype=float32) ```

object exp(IGraphNodeBase x)

Element-wise exponential.
Parameters
IGraphNodeBase x
Tensor or variable.
Returns
object
A tensor.

object exp_dyn(object x)

Calculate the exponential of all elements in the input array.

Tensor expand_dims(PythonClassContainer x, int axis)

Adds a 1-sized dimension at index "axis".
Parameters
PythonClassContainer x
A tensor or variable.
int axis
Position where to add a new axis.
Returns
Tensor
A tensor with expanded dimensions.

Tensor expand_dims(IGraphNodeBase x, int axis)

Adds a 1-sized dimension at index "axis".
Parameters
IGraphNodeBase x
A tensor or variable.
int axis
Position where to add a new axis.
Returns
Tensor
A tensor with expanded dimensions.

Tensor expand_dims(IndexedSlices x, int axis)

Adds a 1-sized dimension at index "axis".
Parameters
IndexedSlices x
A tensor or variable.
int axis
Position where to add a new axis.
Returns
Tensor
A tensor with expanded dimensions.

Tensor expand_dims(IEnumerable<IGraphNodeBase> x, int axis)

Adds a 1-sized dimension at index "axis".
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
int axis
Position where to add a new axis.
Returns
Tensor
A tensor with expanded dimensions.

object expand_dims_dyn(object x, ImplicitContainer<T> axis)

Adds a 1-sized dimension at index "axis".
Parameters
object x
A tensor or variable.
ImplicitContainer<T> axis
Position where to add a new axis.
Returns
object
A tensor with expanded dimensions.

object eye(int size, DType dtype, string name)

Instantiate an identity matrix and returns it.
Parameters
int size
Integer, number of rows/columns.
DType dtype
String, data type of returned Keras variable.
string name
String, name of returned Keras variable.
Returns
object
A Keras variable, an identity matrix.

Example: ```python >>> from keras import backend as K >>> kvar = K.eye(3) >>> K.eval(kvar) array([[ 1., 0., 0.], [ 0., 1., 0.], [ 0., 0., 1.]], dtype=float32) ```

object eye_dyn(object size, object dtype, object name)

Instantiate an identity matrix and returns it.
Parameters
object size
Integer, number of rows/columns.
object dtype
String, data type of returned Keras variable.
object name
String, name of returned Keras variable.
Returns
object
A Keras variable, an identity matrix.

Example: ```python >>> from keras import backend as K >>> kvar = K.eye(3) >>> K.eval(kvar) array([[ 1., 0., 0.], [ 0., 1., 0.], [ 0., 0., 1.]], dtype=float32) ```

Tensor flatten(IndexedSlices x)

Flatten a tensor.
Parameters
IndexedSlices x
A tensor or variable.
Returns
Tensor
A tensor, reshaped into 1-D

Example: ```python >>> b = tf.constant([[1, 2], [3, 4]]) >>> b >>> tf.keras.backend.flatten(b) ```

Tensor flatten(ValueTuple<PythonClassContainer, PythonClassContainer> x)

Flatten a tensor.
Parameters
ValueTuple<PythonClassContainer, PythonClassContainer> x
A tensor or variable.
Returns
Tensor
A tensor, reshaped into 1-D

Example: ```python >>> b = tf.constant([[1, 2], [3, 4]]) >>> b >>> tf.keras.backend.flatten(b) ```

Tensor flatten(IGraphNodeBase x)

Flatten a tensor.
Parameters
IGraphNodeBase x
A tensor or variable.
Returns
Tensor
A tensor, reshaped into 1-D

Example: ```python >>> b = tf.constant([[1, 2], [3, 4]]) >>> b >>> tf.keras.backend.flatten(b) ```

string floatx()

Returns the default float type, as a string.

E.g. 'float16', 'float32', 'float64'.
Returns
string
String, the current default float type.

Example: ```python keras.backend.floatx() >>> 'float32' ```

object floatx_dyn()

Returns the default float type, as a string.

E.g. 'float16', 'float32', 'float64'.
Returns
object
String, the current default float type.

Example: ```python keras.backend.floatx() >>> 'float32' ```

object foldl(object fn, object elems, object initializer, string name)

Reduce elems using fn to combine them from left to right.
Parameters
object fn
Callable that will be called upon each element in elems and an accumulator, for instance `lambda acc, x: acc + x`
object elems
tensor
object initializer
The first value used (`elems[0]` in case of None)
string name
A string name for the foldl node in the graph
Returns
object
Tensor with same type and shape as `initializer`.

object foldr(object fn, object elems, object initializer, string name)

Reduce elems using fn to combine them from right to left.
Parameters
object fn
Callable that will be called upon each element in elems and an accumulator, for instance `lambda acc, x: acc + x`
object elems
tensor
object initializer
The first value used (`elems[-1]` in case of None)
string name
A string name for the foldr node in the graph
Returns
object
Same type and shape as initializer

object foldr_dyn(object fn, object elems, object initializer, object name)

Reduce elems using fn to combine them from right to left.
Parameters
object fn
Callable that will be called upon each element in elems and an accumulator, for instance `lambda acc, x: acc + x`
object elems
tensor
object initializer
The first value used (`elems[-1]` in case of None)
object name
A string name for the foldr node in the graph
Returns
object
Same type and shape as initializer

object function(IEnumerable<IGraphNodeBase> inputs, IEnumerable<IGraphNodeBase> outputs, IEnumerable<ValueTuple<object, object>> updates, string name, IDictionary<string, object> kwargs)

Instantiates a Keras function.
Parameters
IEnumerable<IGraphNodeBase> inputs
List of placeholder tensors.
IEnumerable<IGraphNodeBase> outputs
List of output tensors.
IEnumerable<ValueTuple<object, object>> updates
List of update ops.
string name
String, name of function.
IDictionary<string, object> kwargs
Passed to tf.Session.run.
Returns
object
Output values as Numpy arrays.

object function(IGraphNodeBase inputs, IDictionary<object, IGraphNodeBase> outputs, IEnumerable<ValueTuple<object, object>> updates, string name, IDictionary<string, object> kwargs)

Instantiates a Keras function.
Parameters
IGraphNodeBase inputs
List of placeholder tensors.
IDictionary<object, IGraphNodeBase> outputs
List of output tensors.
IEnumerable<ValueTuple<object, object>> updates
List of update ops.
string name
String, name of function.
IDictionary<string, object> kwargs
Passed to tf.Session.run.
Returns
object
Output values as Numpy arrays.

object function(IEnumerable<IGraphNodeBase> inputs, IDictionary<object, IGraphNodeBase> outputs, IEnumerable<ValueTuple<object, object>> updates, string name, IDictionary<string, object> kwargs)

Instantiates a Keras function.
Parameters
IEnumerable<IGraphNodeBase> inputs
List of placeholder tensors.
IDictionary<object, IGraphNodeBase> outputs
List of output tensors.
IEnumerable<ValueTuple<object, object>> updates
List of update ops.
string name
String, name of function.
IDictionary<string, object> kwargs
Passed to tf.Session.run.
Returns
object
Output values as Numpy arrays.

object function(IEnumerable<IGraphNodeBase> inputs, object outputs, IEnumerable<ValueTuple<object, object>> updates, string name, IDictionary<string, object> kwargs)

Instantiates a Keras function.
Parameters
IEnumerable<IGraphNodeBase> inputs
List of placeholder tensors.
object outputs
List of output tensors.
IEnumerable<ValueTuple<object, object>> updates
List of update ops.
string name
String, name of function.
IDictionary<string, object> kwargs
Passed to tf.Session.run.
Returns
object
Output values as Numpy arrays.

object function(IDictionary<string, object> inputs, object outputs, IEnumerable<ValueTuple<object, object>> updates, string name, IDictionary<string, object> kwargs)

Instantiates a Keras function.
Parameters
IDictionary<string, object> inputs
List of placeholder tensors.
object outputs
List of output tensors.
IEnumerable<ValueTuple<object, object>> updates
List of update ops.
string name
String, name of function.
IDictionary<string, object> kwargs
Passed to tf.Session.run.
Returns
object
Output values as Numpy arrays.

object function(IGraphNodeBase inputs, IEnumerable<IGraphNodeBase> outputs, IEnumerable<ValueTuple<object, object>> updates, string name, IDictionary<string, object> kwargs)

Instantiates a Keras function.
Parameters
IGraphNodeBase inputs
List of placeholder tensors.
IEnumerable<IGraphNodeBase> outputs
List of output tensors.
IEnumerable<ValueTuple<object, object>> updates
List of update ops.
string name
String, name of function.
IDictionary<string, object> kwargs
Passed to tf.Session.run.
Returns
object
Output values as Numpy arrays.

object function(IGraphNodeBase inputs, IGraphNodeBase outputs, IEnumerable<ValueTuple<object, object>> updates, string name, IDictionary<string, object> kwargs)

Instantiates a Keras function.
Parameters
IGraphNodeBase inputs
List of placeholder tensors.
IGraphNodeBase outputs
List of output tensors.
IEnumerable<ValueTuple<object, object>> updates
List of update ops.
string name
String, name of function.
IDictionary<string, object> kwargs
Passed to tf.Session.run.
Returns
object
Output values as Numpy arrays.

object function(IDictionary<string, object> inputs, IGraphNodeBase outputs, IEnumerable<ValueTuple<object, object>> updates, string name, IDictionary<string, object> kwargs)

Instantiates a Keras function.
Parameters
IDictionary<string, object> inputs
List of placeholder tensors.
IGraphNodeBase outputs
List of output tensors.
IEnumerable<ValueTuple<object, object>> updates
List of update ops.
string name
String, name of function.
IDictionary<string, object> kwargs
Passed to tf.Session.run.
Returns
object
Output values as Numpy arrays.

object function(IDictionary<string, object> inputs, IEnumerable<IGraphNodeBase> outputs, IEnumerable<ValueTuple<object, object>> updates, string name, IDictionary<string, object> kwargs)

Instantiates a Keras function.
Parameters
IDictionary<string, object> inputs
List of placeholder tensors.
IEnumerable<IGraphNodeBase> outputs
List of output tensors.
IEnumerable<ValueTuple<object, object>> updates
List of update ops.
string name
String, name of function.
IDictionary<string, object> kwargs
Passed to tf.Session.run.
Returns
object
Output values as Numpy arrays.

object function(IDictionary<string, object> inputs, IDictionary<object, IGraphNodeBase> outputs, IEnumerable<ValueTuple<object, object>> updates, string name, IDictionary<string, object> kwargs)

Instantiates a Keras function.
Parameters
IDictionary<string, object> inputs
List of placeholder tensors.
IDictionary<object, IGraphNodeBase> outputs
List of output tensors.
IEnumerable<ValueTuple<object, object>> updates
List of update ops.
string name
String, name of function.
IDictionary<string, object> kwargs
Passed to tf.Session.run.
Returns
object
Output values as Numpy arrays.

object function(IGraphNodeBase inputs, object outputs, IEnumerable<ValueTuple<object, object>> updates, string name, IDictionary<string, object> kwargs)

Instantiates a Keras function.
Parameters
IGraphNodeBase inputs
List of placeholder tensors.
object outputs
List of output tensors.
IEnumerable<ValueTuple<object, object>> updates
List of update ops.
string name
String, name of function.
IDictionary<string, object> kwargs
Passed to tf.Session.run.
Returns
object
Output values as Numpy arrays.

object function(IEnumerable<IGraphNodeBase> inputs, IGraphNodeBase outputs, IEnumerable<ValueTuple<object, object>> updates, string name, IDictionary<string, object> kwargs)

Instantiates a Keras function.
Parameters
IEnumerable<IGraphNodeBase> inputs
List of placeholder tensors.
IGraphNodeBase outputs
List of output tensors.
IEnumerable<ValueTuple<object, object>> updates
List of update ops.
string name
String, name of function.
IDictionary<string, object> kwargs
Passed to tf.Session.run.
Returns
object
Output values as Numpy arrays.

object function_dyn(object inputs, object outputs, object updates, object name, IDictionary<string, object> kwargs)

Instantiates a Keras function.
Parameters
object inputs
List of placeholder tensors.
object outputs
List of output tensors.
object updates
List of update ops.
object name
String, name of function.
IDictionary<string, object> kwargs
Passed to tf.Session.run.
Returns
object
Output values as Numpy arrays.

BaseSession get_session(ImplicitContainer<T> op_input_list)

Returns the TF session to be used by the backend.

If a default TensorFlow session is available, we will return it.

Else, we will return the global Keras session assuming it matches the current graph.

If no global Keras session exists at this point: we will create a new global session.

Note that you can manually set the global session via `K.set_session(sess)`.
Parameters
ImplicitContainer<T> op_input_list
An option sequence of tensors or ops, which will be used to determine the current graph. Otherwise the default graph will be used.
Returns
BaseSession
A TensorFlow session.

BaseSession get_session(object op_input_list)

Returns the TF session to be used by the backend.

If a default TensorFlow session is available, we will return it.

Else, we will return the global Keras session assuming it matches the current graph.

If no global Keras session exists at this point: we will create a new global session.

Note that you can manually set the global session via `K.set_session(sess)`.
Parameters
object op_input_list
An option sequence of tensors or ops, which will be used to determine the current graph. Otherwise the default graph will be used.
Returns
BaseSession
A TensorFlow session.

object get_session_dyn(ImplicitContainer<T> op_input_list)

Returns the TF session to be used by the backend.

If a default TensorFlow session is available, we will return it.

Else, we will return the global Keras session assuming it matches the current graph.

If no global Keras session exists at this point: we will create a new global session.

Note that you can manually set the global session via `K.set_session(sess)`.
Parameters
ImplicitContainer<T> op_input_list
An option sequence of tensors or ops, which will be used to determine the current graph. Otherwise the default graph will be used.
Returns
object
A TensorFlow session.

object get_uid(string prefix)

Associates a string prefix with an integer counter in a TensorFlow graph.
Parameters
string prefix
String prefix to index.
Returns
object
Unique integer ID.

Example:

``` >>> get_uid('dense') 1 >>> get_uid('dense') 2 ```

object get_uid_dyn(ImplicitContainer<T> prefix)

Associates a string prefix with an integer counter in a TensorFlow graph.
Parameters
ImplicitContainer<T> prefix
String prefix to index.
Returns
object
Unique integer ID.

Example:

``` >>> get_uid('dense') 1 >>> get_uid('dense') 2 ```

object get_value(IEnumerable<IGraphNodeBase> x)

Returns the value of a variable.
Parameters
IEnumerable<IGraphNodeBase> x
input variable.
Returns
object
A Numpy array.

object get_value(PythonFunctionContainer x)

Returns the value of a variable.
Parameters
PythonFunctionContainer x
input variable.
Returns
object
A Numpy array.

IList<Tensor> gradients(object loss, IEnumerable<Variable> variables)

Returns the gradients of `loss` w.r.t. `variables`.
Parameters
object loss
Scalar tensor to minimize.
IEnumerable<Variable> variables
List of variables.
Returns
IList<Tensor>
A gradients tensor.

IList<Tensor> gradients(double loss, IEnumerable<Variable> variables)

Returns the gradients of `loss` w.r.t. `variables`.
Parameters
double loss
Scalar tensor to minimize.
IEnumerable<Variable> variables
List of variables.
Returns
IList<Tensor>
A gradients tensor.

object gradients_dyn(object loss, object variables)

Returns the gradients of `loss` w.r.t. `variables`.
Parameters
object loss
Scalar tensor to minimize.
object variables
List of variables.
Returns
object
A gradients tensor.

object greater(IGraphNodeBase x, IGraphNodeBase y)

Element-wise truth value of (x > y).
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase y
Tensor or variable.
Returns
object
A bool tensor.

object greater_dyn(object x, object y)

Element-wise truth value of (x > y).
Parameters
object x
Tensor or variable.
object y
Tensor or variable.
Returns
object
A bool tensor.

object greater_equal(object x, object y)

Element-wise truth value of (x >= y).
Parameters
object x
Tensor or variable.
object y
Tensor or variable.
Returns
object
A bool tensor.

object greater_equal_dyn(object x, object y)

Element-wise truth value of (x >= y).
Parameters
object x
Tensor or variable.
object y
Tensor or variable.
Returns
object
A bool tensor.

string image_data_format()

Returns the default image data format convention.
Returns
string
A string, either `'channels_first'` or `'channels_last'`

Example: ```python keras.backend.image_data_format() >>> 'channels_first' ```

object image_data_format_dyn()

Returns the default image data format convention.
Returns
object
A string, either `'channels_first'` or `'channels_last'`

Example: ```python keras.backend.image_data_format() >>> 'channels_first' ```

object in_test_phase(object x, object alt, object training)

Selects `x` in test phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
object x
What to return in test phase (tensor or callable that returns a tensor).
object alt
What to return otherwise (tensor or callable that returns a tensor).
object training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on `K.learning_phase`.

object in_test_phase_dyn(object x, object alt, object training)

Selects `x` in test phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
object x
What to return in test phase (tensor or callable that returns a tensor).
object alt
What to return otherwise (tensor or callable that returns a tensor).
object training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on `K.learning_phase`.

Tensor in_top_k(object predictions, object targets, object k)

Returns whether the `targets` are in the top `k` `predictions`.
Parameters
object predictions
A tensor of shape `(batch_size, classes)` and type `float32`.
object targets
A 1D tensor of length `batch_size` and type `int32` or `int64`.
object k
An `int`, number of top elements to consider.
Returns
Tensor
A 1D tensor of length `batch_size` and type `bool`. `output[i]` is `True` if `predictions[i, targets[i]]` is within top-`k` values of `predictions[i]`.

object in_top_k_dyn(object predictions, object targets, object k)

Returns whether the `targets` are in the top `k` `predictions`.
Parameters
object predictions
A tensor of shape `(batch_size, classes)` and type `float32`.
object targets
A 1D tensor of length `batch_size` and type `int32` or `int64`.
object k
An `int`, number of top elements to consider.
Returns
object
A 1D tensor of length `batch_size` and type `bool`. `output[i]` is `True` if `predictions[i, targets[i]]` is within top-`k` values of `predictions[i]`.

object in_train_phase(PythonFunctionContainer x, IEnumerable<IGraphNodeBase> alt, bool training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
PythonFunctionContainer x
What to return in train phase (tensor or callable that returns a tensor).
IEnumerable<IGraphNodeBase> alt
What to return otherwise (tensor or callable that returns a tensor).
bool training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(PythonFunctionContainer x, IEnumerable<IGraphNodeBase> alt, int training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
PythonFunctionContainer x
What to return in train phase (tensor or callable that returns a tensor).
IEnumerable<IGraphNodeBase> alt
What to return otherwise (tensor or callable that returns a tensor).
int training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(PythonFunctionContainer x, IEnumerable<IGraphNodeBase> alt, IGraphNodeBase training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
PythonFunctionContainer x
What to return in train phase (tensor or callable that returns a tensor).
IEnumerable<IGraphNodeBase> alt
What to return otherwise (tensor or callable that returns a tensor).
IGraphNodeBase training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(PythonFunctionContainer x, IGraphNodeBase alt, bool training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
PythonFunctionContainer x
What to return in train phase (tensor or callable that returns a tensor).
IGraphNodeBase alt
What to return otherwise (tensor or callable that returns a tensor).
bool training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(PythonFunctionContainer x, IGraphNodeBase alt, int training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
PythonFunctionContainer x
What to return in train phase (tensor or callable that returns a tensor).
IGraphNodeBase alt
What to return otherwise (tensor or callable that returns a tensor).
int training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(PythonFunctionContainer x, IGraphNodeBase alt, IGraphNodeBase training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
PythonFunctionContainer x
What to return in train phase (tensor or callable that returns a tensor).
IGraphNodeBase alt
What to return otherwise (tensor or callable that returns a tensor).
IGraphNodeBase training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(object x, IGraphNodeBase alt, int training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
object x
What to return in train phase (tensor or callable that returns a tensor).
IGraphNodeBase alt
What to return otherwise (tensor or callable that returns a tensor).
int training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(PythonFunctionContainer x, object alt, int training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
PythonFunctionContainer x
What to return in train phase (tensor or callable that returns a tensor).
object alt
What to return otherwise (tensor or callable that returns a tensor).
int training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(PythonFunctionContainer x, object alt, bool training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
PythonFunctionContainer x
What to return in train phase (tensor or callable that returns a tensor).
object alt
What to return otherwise (tensor or callable that returns a tensor).
bool training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(object x, object alt, bool training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
object x
What to return in train phase (tensor or callable that returns a tensor).
object alt
What to return otherwise (tensor or callable that returns a tensor).
bool training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(object x, IGraphNodeBase alt, bool training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
object x
What to return in train phase (tensor or callable that returns a tensor).
IGraphNodeBase alt
What to return otherwise (tensor or callable that returns a tensor).
bool training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(object x, IGraphNodeBase alt, IGraphNodeBase training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
object x
What to return in train phase (tensor or callable that returns a tensor).
IGraphNodeBase alt
What to return otherwise (tensor or callable that returns a tensor).
IGraphNodeBase training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(object x, IEnumerable<IGraphNodeBase> alt, int training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
object x
What to return in train phase (tensor or callable that returns a tensor).
IEnumerable<IGraphNodeBase> alt
What to return otherwise (tensor or callable that returns a tensor).
int training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(object x, IEnumerable<IGraphNodeBase> alt, bool training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
object x
What to return in train phase (tensor or callable that returns a tensor).
IEnumerable<IGraphNodeBase> alt
What to return otherwise (tensor or callable that returns a tensor).
bool training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(object x, IEnumerable<IGraphNodeBase> alt, IGraphNodeBase training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
object x
What to return in train phase (tensor or callable that returns a tensor).
IEnumerable<IGraphNodeBase> alt
What to return otherwise (tensor or callable that returns a tensor).
IGraphNodeBase training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(object x, object alt, IGraphNodeBase training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
object x
What to return in train phase (tensor or callable that returns a tensor).
object alt
What to return otherwise (tensor or callable that returns a tensor).
IGraphNodeBase training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(object x, object alt, int training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
object x
What to return in train phase (tensor or callable that returns a tensor).
object alt
What to return otherwise (tensor or callable that returns a tensor).
int training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase(PythonFunctionContainer x, object alt, IGraphNodeBase training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
PythonFunctionContainer x
What to return in train phase (tensor or callable that returns a tensor).
object alt
What to return otherwise (tensor or callable that returns a tensor).
IGraphNodeBase training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object in_train_phase_dyn(object x, object alt, object training)

Selects `x` in train phase, and `alt` otherwise.

Note that `alt` should have the *same shape* as `x`.
Parameters
object x
What to return in train phase (tensor or callable that returns a tensor).
object alt
What to return otherwise (tensor or callable that returns a tensor).
object training
Optional scalar tensor (or Python boolean, or Python integer) specifying the learning phase.
Returns
object
Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`.

object int_shape(IEnumerable<IGraphNodeBase> x)

Returns the shape of tensor or variable as a tuple of int or None entries.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
Returns
object
A tuple of integers (or None entries).

Examples: ```python >>> from keras import backend as K >>> input = K.placeholder(shape=(2, 4, 5)) >>> K.int_shape(input) (2, 4, 5) >>> val = np.array([[1, 2], [3, 4]]) >>> kvar = K.variable(value=val) >>> K.int_shape(kvar) (2, 2) ```

object int_shape(PythonFunctionContainer x)

Returns the shape of tensor or variable as a tuple of int or None entries.
Parameters
PythonFunctionContainer x
Tensor or variable.
Returns
object
A tuple of integers (or None entries).

Examples: ```python >>> from keras import backend as K >>> input = K.placeholder(shape=(2, 4, 5)) >>> K.int_shape(input) (2, 4, 5) >>> val = np.array([[1, 2], [3, 4]]) >>> kvar = K.variable(value=val) >>> K.int_shape(kvar) (2, 2) ```

object int_shape(object x)

Returns the shape of tensor or variable as a tuple of int or None entries.
Parameters
object x
Tensor or variable.
Returns
object
A tuple of integers (or None entries).

Examples: ```python >>> from keras import backend as K >>> input = K.placeholder(shape=(2, 4, 5)) >>> K.int_shape(input) (2, 4, 5) >>> val = np.array([[1, 2], [3, 4]]) >>> kvar = K.variable(value=val) >>> K.int_shape(kvar) (2, 2) ```

object int_shape_dyn(object x)

Returns the shape of tensor or variable as a tuple of int or None entries.
Parameters
object x
Tensor or variable.
Returns
object
A tuple of integers (or None entries).

Examples: ```python >>> from keras import backend as K >>> input = K.placeholder(shape=(2, 4, 5)) >>> K.int_shape(input) (2, 4, 5) >>> val = np.array([[1, 2], [3, 4]]) >>> kvar = K.variable(value=val) >>> K.int_shape(kvar) (2, 2) ```

bool is_sparse(IEnumerable<IGraphNodeBase> tensor)

Returns whether a tensor is a sparse tensor.
Parameters
IEnumerable<IGraphNodeBase> tensor
A tensor instance.
Returns
bool
A boolean.

Example: ```python >>> from keras import backend as K >>> a = K.placeholder((2, 2), sparse=False) >>> print(K.is_sparse(a)) False >>> b = K.placeholder((2, 2), sparse=True) >>> print(K.is_sparse(b)) True ```

bool is_sparse(PythonClassContainer tensor)

Returns whether a tensor is a sparse tensor.
Parameters
PythonClassContainer tensor
A tensor instance.
Returns
bool
A boolean.

Example: ```python >>> from keras import backend as K >>> a = K.placeholder((2, 2), sparse=False) >>> print(K.is_sparse(a)) False >>> b = K.placeholder((2, 2), sparse=True) >>> print(K.is_sparse(b)) True ```

Tensor l2_normalize(object x, object axis)

Normalizes a tensor wrt the L2 norm alongside the specified axis.
Parameters
object x
Tensor or variable.
object axis
axis along which to perform normalization.
Returns
Tensor
A tensor.

object l2_normalize_dyn(object x, object axis)

Normalizes a tensor wrt the L2 norm alongside the specified axis.
Parameters
object x
Tensor or variable.
object axis
axis along which to perform normalization.
Returns
object
A tensor.

object learning_phase()

Returns the learning phase flag.

The learning phase flag is a bool tensor (0 = test, 1 = train) to be passed as input to any Keras function that uses a different behavior at train time and test time.
Returns
object
Learning phase (scalar integer tensor or Python integer).

object learning_phase_dyn()

Returns the learning phase flag.

The learning phase flag is a bool tensor (0 = test, 1 = train) to be passed as input to any Keras function that uses a different behavior at train time and test time.
Returns
object
Learning phase (scalar integer tensor or Python integer).

IContextManager<T> learning_phase_scope(Nullable<bool> value)

Provides a scope within which the learning phase is equal to `value`.

The learning phase gets restored to its original value upon exiting the scope.
Parameters
Nullable<bool> value
Learning phase value, either 0 or 1 (integers).

IContextManager<T> learning_phase_scope(int value)

Provides a scope within which the learning phase is equal to `value`.

The learning phase gets restored to its original value upon exiting the scope.
Parameters
int value
Learning phase value, either 0 or 1 (integers).

object learning_phase_scope_dyn(object value)

Provides a scope within which the learning phase is equal to `value`.

The learning phase gets restored to its original value upon exiting the scope.
Parameters
object value
Learning phase value, either 0 or 1 (integers).

object less(IGraphNodeBase x, IGraphNodeBase y)

Element-wise truth value of (x < y).
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase y
Tensor or variable.
Returns
object
A bool tensor.

object less(IGraphNodeBase x, ValueTuple<PythonClassContainer, PythonClassContainer> y)

Element-wise truth value of (x < y).
Parameters
IGraphNodeBase x
Tensor or variable.
ValueTuple<PythonClassContainer, PythonClassContainer> y
Tensor or variable.
Returns
object
A bool tensor.

object less_dyn(object x, object y)

Element-wise truth value of (x < y).
Parameters
object x
Tensor or variable.
object y
Tensor or variable.
Returns
object
A bool tensor.

object less_equal(object x, object y)

Element-wise truth value of (x <= y).
Parameters
object x
Tensor or variable.
object y
Tensor or variable.
Returns
object
A bool tensor.

object less_equal_dyn(object x, object y)

Element-wise truth value of (x <= y).
Parameters
object x
Tensor or variable.
object y
Tensor or variable.
Returns
object
A bool tensor.

object local_conv1d(ReplicatedVariable inputs, IGraphNodeBase kernel, object kernel_size, object strides, string data_format)

Apply 1D conv with un-shared weights.
Parameters
ReplicatedVariable inputs
3D tensor with shape: (batch_size, steps, input_dim) if data_format is "channels_last" or (batch_size, input_dim, steps) if data_format is "channels_first".
IGraphNodeBase kernel
the unshared weight for convolution, with shape (output_length, feature_dim, filters).
object kernel_size
a tuple of a single integer, specifying the length of the 1D convolution window.
object strides
a tuple of a single integer, specifying the stride length of the convolution.
string data_format
the data format, channels_first or channels_last.
Returns
object
A 3d tensor with shape: (batch_size, output_length, filters) if data_format='channels_first' or 3D tensor with shape: (batch_size, filters, output_length) if data_format='channels_last'.

object local_conv1d(ResourceVariable inputs, IGraphNodeBase kernel, object kernel_size, object strides, string data_format)

Apply 1D conv with un-shared weights.
Parameters
ResourceVariable inputs
3D tensor with shape: (batch_size, steps, input_dim) if data_format is "channels_last" or (batch_size, input_dim, steps) if data_format is "channels_first".
IGraphNodeBase kernel
the unshared weight for convolution, with shape (output_length, feature_dim, filters).
object kernel_size
a tuple of a single integer, specifying the length of the 1D convolution window.
object strides
a tuple of a single integer, specifying the stride length of the convolution.
string data_format
the data format, channels_first or channels_last.
Returns
object
A 3d tensor with shape: (batch_size, output_length, filters) if data_format='channels_first' or 3D tensor with shape: (batch_size, filters, output_length) if data_format='channels_last'.

object local_conv1d(ResourceVariable inputs, ResourceVariable kernel, object kernel_size, object strides, string data_format)

Apply 1D conv with un-shared weights.
Parameters
ResourceVariable inputs
3D tensor with shape: (batch_size, steps, input_dim) if data_format is "channels_last" or (batch_size, input_dim, steps) if data_format is "channels_first".
ResourceVariable kernel
the unshared weight for convolution, with shape (output_length, feature_dim, filters).
object kernel_size
a tuple of a single integer, specifying the length of the 1D convolution window.
object strides
a tuple of a single integer, specifying the stride length of the convolution.
string data_format
the data format, channels_first or channels_last.
Returns
object
A 3d tensor with shape: (batch_size, output_length, filters) if data_format='channels_first' or 3D tensor with shape: (batch_size, filters, output_length) if data_format='channels_last'.

object local_conv1d(ResourceVariable inputs, ReplicatedVariable kernel, object kernel_size, object strides, string data_format)

Apply 1D conv with un-shared weights.
Parameters
ResourceVariable inputs
3D tensor with shape: (batch_size, steps, input_dim) if data_format is "channels_last" or (batch_size, input_dim, steps) if data_format is "channels_first".
ReplicatedVariable kernel
the unshared weight for convolution, with shape (output_length, feature_dim, filters).
object kernel_size
a tuple of a single integer, specifying the length of the 1D convolution window.
object strides
a tuple of a single integer, specifying the stride length of the convolution.
string data_format
the data format, channels_first or channels_last.
Returns
object
A 3d tensor with shape: (batch_size, output_length, filters) if data_format='channels_first' or 3D tensor with shape: (batch_size, filters, output_length) if data_format='channels_last'.

object local_conv1d(IGraphNodeBase inputs, ReplicatedVariable kernel, object kernel_size, object strides, string data_format)

Apply 1D conv with un-shared weights.
Parameters
IGraphNodeBase inputs
3D tensor with shape: (batch_size, steps, input_dim) if data_format is "channels_last" or (batch_size, input_dim, steps) if data_format is "channels_first".
ReplicatedVariable kernel
the unshared weight for convolution, with shape (output_length, feature_dim, filters).
object kernel_size
a tuple of a single integer, specifying the length of the 1D convolution window.
object strides
a tuple of a single integer, specifying the stride length of the convolution.
string data_format
the data format, channels_first or channels_last.
Returns
object
A 3d tensor with shape: (batch_size, output_length, filters) if data_format='channels_first' or 3D tensor with shape: (batch_size, filters, output_length) if data_format='channels_last'.

object local_conv1d(IGraphNodeBase inputs, ResourceVariable kernel, object kernel_size, object strides, string data_format)

Apply 1D conv with un-shared weights.
Parameters
IGraphNodeBase inputs
3D tensor with shape: (batch_size, steps, input_dim) if data_format is "channels_last" or (batch_size, input_dim, steps) if data_format is "channels_first".
ResourceVariable kernel
the unshared weight for convolution, with shape (output_length, feature_dim, filters).
object kernel_size
a tuple of a single integer, specifying the length of the 1D convolution window.
object strides
a tuple of a single integer, specifying the stride length of the convolution.
string data_format
the data format, channels_first or channels_last.
Returns
object
A 3d tensor with shape: (batch_size, output_length, filters) if data_format='channels_first' or 3D tensor with shape: (batch_size, filters, output_length) if data_format='channels_last'.

object local_conv1d(ReplicatedVariable inputs, ResourceVariable kernel, object kernel_size, object strides, string data_format)

Apply 1D conv with un-shared weights.
Parameters
ReplicatedVariable inputs
3D tensor with shape: (batch_size, steps, input_dim) if data_format is "channels_last" or (batch_size, input_dim, steps) if data_format is "channels_first".
ResourceVariable kernel
the unshared weight for convolution, with shape (output_length, feature_dim, filters).
object kernel_size
a tuple of a single integer, specifying the length of the 1D convolution window.
object strides
a tuple of a single integer, specifying the stride length of the convolution.
string data_format
the data format, channels_first or channels_last.
Returns
object
A 3d tensor with shape: (batch_size, output_length, filters) if data_format='channels_first' or 3D tensor with shape: (batch_size, filters, output_length) if data_format='channels_last'.

object local_conv1d(IGraphNodeBase inputs, IGraphNodeBase kernel, object kernel_size, object strides, string data_format)

Apply 1D conv with un-shared weights.
Parameters
IGraphNodeBase inputs
3D tensor with shape: (batch_size, steps, input_dim) if data_format is "channels_last" or (batch_size, input_dim, steps) if data_format is "channels_first".
IGraphNodeBase kernel
the unshared weight for convolution, with shape (output_length, feature_dim, filters).
object kernel_size
a tuple of a single integer, specifying the length of the 1D convolution window.
object strides
a tuple of a single integer, specifying the stride length of the convolution.
string data_format
the data format, channels_first or channels_last.
Returns
object
A 3d tensor with shape: (batch_size, output_length, filters) if data_format='channels_first' or 3D tensor with shape: (batch_size, filters, output_length) if data_format='channels_last'.

object local_conv1d(ReplicatedVariable inputs, ReplicatedVariable kernel, object kernel_size, object strides, string data_format)

Apply 1D conv with un-shared weights.
Parameters
ReplicatedVariable inputs
3D tensor with shape: (batch_size, steps, input_dim) if data_format is "channels_last" or (batch_size, input_dim, steps) if data_format is "channels_first".
ReplicatedVariable kernel
the unshared weight for convolution, with shape (output_length, feature_dim, filters).
object kernel_size
a tuple of a single integer, specifying the length of the 1D convolution window.
object strides
a tuple of a single integer, specifying the stride length of the convolution.
string data_format
the data format, channels_first or channels_last.
Returns
object
A 3d tensor with shape: (batch_size, output_length, filters) if data_format='channels_first' or 3D tensor with shape: (batch_size, filters, output_length) if data_format='channels_last'.

object local_conv1d_dyn(object inputs, object kernel, object kernel_size, object strides, object data_format)

Apply 1D conv with un-shared weights.
Parameters
object inputs
3D tensor with shape: (batch_size, steps, input_dim) if data_format is "channels_last" or (batch_size, input_dim, steps) if data_format is "channels_first".
object kernel
the unshared weight for convolution, with shape (output_length, feature_dim, filters).
object kernel_size
a tuple of a single integer, specifying the length of the 1D convolution window.
object strides
a tuple of a single integer, specifying the stride length of the convolution.
object data_format
the data format, channels_first or channels_last.
Returns
object
A 3d tensor with shape: (batch_size, output_length, filters) if data_format='channels_first' or 3D tensor with shape: (batch_size, filters, output_length) if data_format='channels_last'.

object local_conv2d(ResourceVariable inputs, ReplicatedVariable kernel, object kernel_size, object strides, object output_shape, string data_format)

Apply 2D conv with un-shared weights.
Parameters
ResourceVariable inputs
4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.
ReplicatedVariable kernel
the unshared weight for convolution, with shape (output_items, feature_dim, filters).
object kernel_size
a tuple of 2 integers, specifying the width and height of the 2D convolution window.
object strides
a tuple of 2 integers, specifying the strides of the convolution along the width and height.
object output_shape
a tuple with (output_row, output_col).
string data_format
the data format, channels_first or channels_last.
Returns
object
A 4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.

object local_conv2d(IGraphNodeBase inputs, ReplicatedVariable kernel, object kernel_size, object strides, object output_shape, string data_format)

Apply 2D conv with un-shared weights.
Parameters
IGraphNodeBase inputs
4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.
ReplicatedVariable kernel
the unshared weight for convolution, with shape (output_items, feature_dim, filters).
object kernel_size
a tuple of 2 integers, specifying the width and height of the 2D convolution window.
object strides
a tuple of 2 integers, specifying the strides of the convolution along the width and height.
object output_shape
a tuple with (output_row, output_col).
string data_format
the data format, channels_first or channels_last.
Returns
object
A 4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.

object local_conv2d(ResourceVariable inputs, IGraphNodeBase kernel, object kernel_size, object strides, object output_shape, string data_format)

Apply 2D conv with un-shared weights.
Parameters
ResourceVariable inputs
4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.
IGraphNodeBase kernel
the unshared weight for convolution, with shape (output_items, feature_dim, filters).
object kernel_size
a tuple of 2 integers, specifying the width and height of the 2D convolution window.
object strides
a tuple of 2 integers, specifying the strides of the convolution along the width and height.
object output_shape
a tuple with (output_row, output_col).
string data_format
the data format, channels_first or channels_last.
Returns
object
A 4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.

object local_conv2d(ResourceVariable inputs, ResourceVariable kernel, object kernel_size, object strides, object output_shape, string data_format)

Apply 2D conv with un-shared weights.
Parameters
ResourceVariable inputs
4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.
ResourceVariable kernel
the unshared weight for convolution, with shape (output_items, feature_dim, filters).
object kernel_size
a tuple of 2 integers, specifying the width and height of the 2D convolution window.
object strides
a tuple of 2 integers, specifying the strides of the convolution along the width and height.
object output_shape
a tuple with (output_row, output_col).
string data_format
the data format, channels_first or channels_last.
Returns
object
A 4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.

object local_conv2d(ReplicatedVariable inputs, ResourceVariable kernel, object kernel_size, object strides, object output_shape, string data_format)

Apply 2D conv with un-shared weights.
Parameters
ReplicatedVariable inputs
4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.
ResourceVariable kernel
the unshared weight for convolution, with shape (output_items, feature_dim, filters).
object kernel_size
a tuple of 2 integers, specifying the width and height of the 2D convolution window.
object strides
a tuple of 2 integers, specifying the strides of the convolution along the width and height.
object output_shape
a tuple with (output_row, output_col).
string data_format
the data format, channels_first or channels_last.
Returns
object
A 4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.

object local_conv2d(IGraphNodeBase inputs, ResourceVariable kernel, object kernel_size, object strides, object output_shape, string data_format)

Apply 2D conv with un-shared weights.
Parameters
IGraphNodeBase inputs
4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.
ResourceVariable kernel
the unshared weight for convolution, with shape (output_items, feature_dim, filters).
object kernel_size
a tuple of 2 integers, specifying the width and height of the 2D convolution window.
object strides
a tuple of 2 integers, specifying the strides of the convolution along the width and height.
object output_shape
a tuple with (output_row, output_col).
string data_format
the data format, channels_first or channels_last.
Returns
object
A 4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.

object local_conv2d(ReplicatedVariable inputs, IGraphNodeBase kernel, object kernel_size, object strides, object output_shape, string data_format)

Apply 2D conv with un-shared weights.
Parameters
ReplicatedVariable inputs
4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.
IGraphNodeBase kernel
the unshared weight for convolution, with shape (output_items, feature_dim, filters).
object kernel_size
a tuple of 2 integers, specifying the width and height of the 2D convolution window.
object strides
a tuple of 2 integers, specifying the strides of the convolution along the width and height.
object output_shape
a tuple with (output_row, output_col).
string data_format
the data format, channels_first or channels_last.
Returns
object
A 4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.

object local_conv2d(IGraphNodeBase inputs, IGraphNodeBase kernel, object kernel_size, object strides, object output_shape, string data_format)

Apply 2D conv with un-shared weights.
Parameters
IGraphNodeBase inputs
4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.
IGraphNodeBase kernel
the unshared weight for convolution, with shape (output_items, feature_dim, filters).
object kernel_size
a tuple of 2 integers, specifying the width and height of the 2D convolution window.
object strides
a tuple of 2 integers, specifying the strides of the convolution along the width and height.
object output_shape
a tuple with (output_row, output_col).
string data_format
the data format, channels_first or channels_last.
Returns
object
A 4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.

object local_conv2d(ReplicatedVariable inputs, ReplicatedVariable kernel, object kernel_size, object strides, object output_shape, string data_format)

Apply 2D conv with un-shared weights.
Parameters
ReplicatedVariable inputs
4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.
ReplicatedVariable kernel
the unshared weight for convolution, with shape (output_items, feature_dim, filters).
object kernel_size
a tuple of 2 integers, specifying the width and height of the 2D convolution window.
object strides
a tuple of 2 integers, specifying the strides of the convolution along the width and height.
object output_shape
a tuple with (output_row, output_col).
string data_format
the data format, channels_first or channels_last.
Returns
object
A 4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.

object local_conv2d_dyn(object inputs, object kernel, object kernel_size, object strides, object output_shape, object data_format)

Apply 2D conv with un-shared weights.
Parameters
object inputs
4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.
object kernel
the unshared weight for convolution, with shape (output_items, feature_dim, filters).
object kernel_size
a tuple of 2 integers, specifying the width and height of the 2D convolution window.
object strides
a tuple of 2 integers, specifying the strides of the convolution along the width and height.
object output_shape
a tuple with (output_row, output_col).
object data_format
the data format, channels_first or channels_last.
Returns
object
A 4D tensor with shape: (batch_size, filters, new_rows, new_cols) if data_format='channels_first' or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'.

object log(object x)

Element-wise log.
Parameters
object x
Tensor or variable.
Returns
object
A tensor.

object log_dyn(object x)

Element-wise log.
Parameters
object x
Tensor or variable.
Returns
object
A tensor.

void manual_variable_initialization(bool value)

Sets the manual variable initialization flag.

This boolean flag determines whether variables should be initialized as they are instantiated (default), or if the user should handle the initialization (e.g. via `tf.compat.v1.initialize_all_variables()`).
Parameters
bool value
Python boolean.

object manual_variable_initialization_dyn(object value)

Sets the manual variable initialization flag.

This boolean flag determines whether variables should be initialized as they are instantiated (default), or if the user should handle the initialization (e.g. via `tf.compat.v1.initialize_all_variables()`).
Parameters
object value
Python boolean.

PythonFunctionContainer map_fn(PythonFunctionContainer fn, object elems, string name, DType dtype)

Map the function fn over the elements elems and return the outputs.
Parameters
PythonFunctionContainer fn
Callable that will be called upon each element in elems
object elems
tensor
string name
A string name for the map node in the graph
DType dtype
Output data type.
Returns
PythonFunctionContainer
Tensor with dtype `dtype`.

object map_fn_dyn(object fn, object elems, object name, object dtype)

Map the function fn over the elements elems and return the outputs.
Parameters
object fn
Callable that will be called upon each element in elems
object elems
tensor
object name
A string name for the map node in the graph
object dtype
Output data type.
Returns
object
Tensor with dtype `dtype`.

Tensor max(IEnumerable<IGraphNodeBase> x, IEnumerable<int> axis, bool keepdims)

Maximum value in a tensor.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
IEnumerable<int> axis
An integer, the axis to find maximum values.
bool keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
Tensor
A tensor with maximum values of `x`.

Tensor max(IEnumerable<IGraphNodeBase> x, int axis, bool keepdims)

Maximum value in a tensor.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
int axis
An integer, the axis to find maximum values.
bool keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
Tensor
A tensor with maximum values of `x`.

Tensor max(IGraphNodeBase x, int axis, bool keepdims)

Maximum value in a tensor.
Parameters
IGraphNodeBase x
A tensor or variable.
int axis
An integer, the axis to find maximum values.
bool keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
Tensor
A tensor with maximum values of `x`.

Tensor max(IGraphNodeBase x, IEnumerable<int> axis, bool keepdims)

Maximum value in a tensor.
Parameters
IGraphNodeBase x
A tensor or variable.
IEnumerable<int> axis
An integer, the axis to find maximum values.
bool keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
Tensor
A tensor with maximum values of `x`.

object max_dyn(object x, object axis, ImplicitContainer<T> keepdims)

Maximum value in a tensor.
Parameters
object x
A tensor or variable.
object axis
An integer, the axis to find maximum values.
ImplicitContainer<T> keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
object
A tensor with maximum values of `x`.

object maximum(object x, object y)

Element-wise maximum of two tensors.
Parameters
object x
Tensor or variable.
object y
Tensor or variable.
Returns
object
A tensor with the element wise maximum value(s) of `x` and `y`.

Examples: ```python # maximum of two tensors >>> x = tf.Variable([[1, 2], [3, 4]]) >>> y = tf.Variable([[2, 1], [0, -1]]) >>> m = tf.keras.backend.maximum(x, y) >>> m ```

object maximum_dyn(object x, object y)

Element-wise maximum of two tensors.
Parameters
object x
Tensor or variable.
object y
Tensor or variable.
Returns
object
A tensor with the element wise maximum value(s) of `x` and `y`.

Examples: ```python # maximum of two tensors >>> x = tf.Variable([[1, 2], [3, 4]]) >>> y = tf.Variable([[2, 1], [0, -1]]) >>> m = tf.keras.backend.maximum(x, y) >>> m ```

Tensor mean(IGraphNodeBase x, IEnumerable<int> axis, bool keepdims)

Mean of a tensor, alongside the specified axis.
Parameters
IGraphNodeBase x
A tensor or variable.
IEnumerable<int> axis
A list of integer. Axes to compute the mean.
bool keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keepdims` is `True`, the reduced dimensions are retained with length 1.
Returns
Tensor
A tensor with the mean of elements of `x`.

Tensor mean(IEnumerable<IGraphNodeBase> x, IEnumerable<int> axis, bool keepdims)

Mean of a tensor, alongside the specified axis.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
IEnumerable<int> axis
A list of integer. Axes to compute the mean.
bool keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keepdims` is `True`, the reduced dimensions are retained with length 1.
Returns
Tensor
A tensor with the mean of elements of `x`.

Tensor mean(IEnumerable<IGraphNodeBase> x, int axis, bool keepdims)

Mean of a tensor, alongside the specified axis.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
int axis
A list of integer. Axes to compute the mean.
bool keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keepdims` is `True`, the reduced dimensions are retained with length 1.
Returns
Tensor
A tensor with the mean of elements of `x`.

Tensor mean(IGraphNodeBase x, int axis, bool keepdims)

Mean of a tensor, alongside the specified axis.
Parameters
IGraphNodeBase x
A tensor or variable.
int axis
A list of integer. Axes to compute the mean.
bool keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keepdims` is `True`, the reduced dimensions are retained with length 1.
Returns
Tensor
A tensor with the mean of elements of `x`.

object mean_dyn(object x, object axis, ImplicitContainer<T> keepdims)

Mean of a tensor, alongside the specified axis.
Parameters
object x
A tensor or variable.
object axis
A list of integer. Axes to compute the mean.
ImplicitContainer<T> keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keepdims` is `True`, the reduced dimensions are retained with length 1.
Returns
object
A tensor with the mean of elements of `x`.

Tensor min(object x, object axis, bool keepdims)

Minimum value in a tensor.
Parameters
object x
A tensor or variable.
object axis
An integer, the axis to find minimum values.
bool keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
Tensor
A tensor with minimum values of `x`.

object min_dyn(object x, object axis, ImplicitContainer<T> keepdims)

Minimum value in a tensor.
Parameters
object x
A tensor or variable.
object axis
An integer, the axis to find minimum values.
ImplicitContainer<T> keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
object
A tensor with minimum values of `x`.

object minimum(IGraphNodeBase x, IGraphNodeBase y)

Element-wise minimum of two tensors.
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase y
Tensor or variable.
Returns
object
A tensor.

object minimum_dyn(object x, object y)

Element-wise minimum of two tensors.
Parameters
object x
Tensor or variable.
object y
Tensor or variable.
Returns
object
A tensor.

object moving_average_update(object x, object value, object momentum)

Compute the moving average of a variable.
Parameters
object x
A Variable.
object value
A tensor with the same shape as `variable`.
object momentum
The moving average momentum.
Returns
object
An Operation to update the variable.

object moving_average_update_dyn(object x, object value, object momentum)

Compute the moving average of a variable.
Parameters
object x
A Variable.
object value
A tensor with the same shape as `variable`.
object momentum
The moving average momentum.
Returns
object
An Operation to update the variable.

name_scope name_scope(IEnumerator<object> name)

Nullable<int> ndim(IEnumerable<IGraphNodeBase> x)

Returns the number of axes in a tensor, as an integer.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
Returns
Nullable<int>
Integer (scalar), number of axes.

Examples: ```python >>> from keras import backend as K >>> input = K.placeholder(shape=(2, 4, 5)) >>> val = np.array([[1, 2], [3, 4]]) >>> kvar = K.variable(value=val) >>> K.ndim(input) 3 >>> K.ndim(kvar) 2 ```

Nullable<int> ndim(PythonFunctionContainer x)

Returns the number of axes in a tensor, as an integer.
Parameters
PythonFunctionContainer x
Tensor or variable.
Returns
Nullable<int>
Integer (scalar), number of axes.

Examples: ```python >>> from keras import backend as K >>> input = K.placeholder(shape=(2, 4, 5)) >>> val = np.array([[1, 2], [3, 4]]) >>> kvar = K.variable(value=val) >>> K.ndim(input) 3 >>> K.ndim(kvar) 2 ```

Nullable<int> ndim(object x)

Returns the number of axes in a tensor, as an integer.
Parameters
object x
Tensor or variable.
Returns
Nullable<int>
Integer (scalar), number of axes.

Examples: ```python >>> from keras import backend as K >>> input = K.placeholder(shape=(2, 4, 5)) >>> val = np.array([[1, 2], [3, 4]]) >>> kvar = K.variable(value=val) >>> K.ndim(input) 3 >>> K.ndim(kvar) 2 ```

object ndim_dyn(object x)

Returns the number of axes in a tensor, as an integer.
Parameters
object x
Tensor or variable.
Returns
object
Integer (scalar), number of axes.

Examples: ```python >>> from keras import backend as K >>> input = K.placeholder(shape=(2, 4, 5)) >>> val = np.array([[1, 2], [3, 4]]) >>> kvar = K.variable(value=val) >>> K.ndim(input) 3 >>> K.ndim(kvar) 2 ```

ValueTuple<object, object, object> normalize_batch_in_training(IGraphNodeBase x, IGraphNodeBase gamma, IGraphNodeBase beta, ValueTuple<int, int, int> reduction_axes, double epsilon)

Computes mean and std for batch then apply batch_normalization on batch.
Parameters
IGraphNodeBase x
Input tensor or variable.
IGraphNodeBase gamma
Tensor by which to scale the input.
IGraphNodeBase beta
Tensor with which to center the input.
ValueTuple<int, int, int> reduction_axes
iterable of integers, axes over which to normalize.
double epsilon
Fuzz factor.
Returns
ValueTuple<object, object, object>
A tuple length of 3, `(normalized_tensor, mean, variance)`.

object normalize_batch_in_training_dyn(object x, object gamma, object beta, object reduction_axes, ImplicitContainer<T> epsilon)

Computes mean and std for batch then apply batch_normalization on batch.
Parameters
object x
Input tensor or variable.
object gamma
Tensor by which to scale the input.
object beta
Tensor with which to center the input.
object reduction_axes
iterable of integers, axes over which to normalize.
ImplicitContainer<T> epsilon
Fuzz factor.
Returns
object
A tuple length of 3, `(normalized_tensor, mean, variance)`.

Tensor not_equal(object x, object y)

Element-wise inequality between two tensors.
Parameters
object x
Tensor or variable.
object y
Tensor or variable.
Returns
Tensor
A bool tensor.

object not_equal_dyn(object x, object y)

Element-wise inequality between two tensors.
Parameters
object x
Tensor or variable.
object y
Tensor or variable.
Returns
object
A bool tensor.

Tensor one_hot(object indices, object num_classes)

Computes the one-hot representation of an integer tensor.
Parameters
object indices
nD integer tensor of shape `(batch_size, dim1, dim2,... dim(n-1))`
object num_classes
Integer, number of classes to consider.
Returns
Tensor
(n + 1)D one hot representation of the input with shape `(batch_size, dim1, dim2,... dim(n-1), num_classes)`

object one_hot_dyn(object indices, object num_classes)

Computes the one-hot representation of an integer tensor.
Parameters
object indices
nD integer tensor of shape `(batch_size, dim1, dim2,... dim(n-1))`
object num_classes
Integer, number of classes to consider.
Returns
object
(n + 1)D one hot representation of the input with shape `(batch_size, dim1, dim2,... dim(n-1), num_classes)`

object ones(ValueTuple<int, int> shape, DType dtype, string name)

Instantiates an all-ones variable and returns it.
Parameters
ValueTuple<int, int> shape
Tuple of integers, shape of returned Keras variable.
DType dtype
String, data type of returned Keras variable.
string name
String, name of returned Keras variable.
Returns
object
A Keras variable, filled with `1.0`. Note that if `shape` was symbolic, we cannot return a variable, and will return a dynamically-shaped tensor instead.

Example: ```python >>> from keras import backend as K >>> kvar = K.ones((3,4)) >>> K.eval(kvar) array([[ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.]], dtype=float32) ```

object ones_dyn(object shape, object dtype, object name)

Instantiates an all-ones variable and returns it.
Parameters
object shape
Tuple of integers, shape of returned Keras variable.
object dtype
String, data type of returned Keras variable.
object name
String, name of returned Keras variable.
Returns
object
A Keras variable, filled with `1.0`. Note that if `shape` was symbolic, we cannot return a variable, and will return a dynamically-shaped tensor instead.

Example: ```python >>> from keras import backend as K >>> kvar = K.ones((3,4)) >>> K.eval(kvar) array([[ 1., 1., 1., 1.], [ 1., 1., 1., 1.], [ 1., 1., 1., 1.]], dtype=float32) ```

Tensor ones_like(IndexedSlices x, DType dtype, string name)

Instantiates an all-ones variable of the same shape as another tensor.
Parameters
IndexedSlices x
Keras variable or tensor.
DType dtype
String, dtype of returned Keras variable. None uses the dtype of x.
string name
String, name for the variable to create.
Returns
Tensor
A Keras variable with the shape of x filled with ones.

Example: ```python >>> from keras import backend as K >>> kvar = K.variable(np.random.random((2,3))) >>> kvar_ones = K.ones_like(kvar) >>> K.eval(kvar_ones) array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) ```

Tensor ones_like(ValueTuple<PythonClassContainer, PythonClassContainer> x, DType dtype, string name)

Instantiates an all-ones variable of the same shape as another tensor.
Parameters
ValueTuple<PythonClassContainer, PythonClassContainer> x
Keras variable or tensor.
DType dtype
String, dtype of returned Keras variable. None uses the dtype of x.
string name
String, name for the variable to create.
Returns
Tensor
A Keras variable with the shape of x filled with ones.

Example: ```python >>> from keras import backend as K >>> kvar = K.variable(np.random.random((2,3))) >>> kvar_ones = K.ones_like(kvar) >>> K.eval(kvar_ones) array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) ```

Tensor permute_dimensions(IGraphNodeBase x, IEnumerable<int> pattern)

Permutes axes in a tensor.
Parameters
IGraphNodeBase x
Tensor or variable.
IEnumerable<int> pattern
A tuple of dimension indices, e.g. `(0, 2, 1)`.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.permute_dimensions(a, pattern=(1, 0)) ```

Tensor permute_dimensions(IGraphNodeBase x, int pattern)

Permutes axes in a tensor.
Parameters
IGraphNodeBase x
Tensor or variable.
int pattern
A tuple of dimension indices, e.g. `(0, 2, 1)`.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.permute_dimensions(a, pattern=(1, 0)) ```

object permute_dimensions_dyn(object x, object pattern)

Permutes axes in a tensor.
Parameters
object x
Tensor or variable.
object pattern
A tuple of dimension indices, e.g. `(0, 2, 1)`.
Returns
object
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.permute_dimensions(a, pattern=(1, 0)) ```

object placeholder(TensorShape shape, Nullable<int> ndim, PythonClassContainer dtype, Nullable<bool> sparse, string name, Nullable<bool> ragged)

Instantiates a placeholder tensor and returns it.
Parameters
TensorShape shape
Shape of the placeholder (integer tuple, may include `None` entries).
Nullable<int> ndim
Number of axes of the tensor. At least one of {`shape`, `ndim`} must be specified. If both are specified, `shape` is used.
PythonClassContainer dtype
Placeholder type.
Nullable<bool> sparse
Boolean, whether the placeholder should have a sparse type.
string name
Optional name string for the placeholder.
Nullable<bool> ragged
Boolean, whether the placeholder should have a ragged type. In this case, values of 'None' in the 'shape' argument represent ragged dimensions. For more information about RaggedTensors, see this [guide](https://www.tensorflow.org/guide/ragged_tensors).
Returns
object
Tensor instance (with Keras metadata included).

Examples: ```python >>> from keras import backend as K >>> input_ph = K.placeholder(shape=(2, 4, 5)) >>> input_ph ```

object placeholder(TensorShape shape, Nullable<int> ndim, dtype dtype, Nullable<bool> sparse, string name, Nullable<bool> ragged)

Instantiates a placeholder tensor and returns it.
Parameters
TensorShape shape
Shape of the placeholder (integer tuple, may include `None` entries).
Nullable<int> ndim
Number of axes of the tensor. At least one of {`shape`, `ndim`} must be specified. If both are specified, `shape` is used.
dtype dtype
Placeholder type.
Nullable<bool> sparse
Boolean, whether the placeholder should have a sparse type.
string name
Optional name string for the placeholder.
Nullable<bool> ragged
Boolean, whether the placeholder should have a ragged type. In this case, values of 'None' in the 'shape' argument represent ragged dimensions. For more information about RaggedTensors, see this [guide](https://www.tensorflow.org/guide/ragged_tensors).
Returns
object
Tensor instance (with Keras metadata included).

Examples: ```python >>> from keras import backend as K >>> input_ph = K.placeholder(shape=(2, 4, 5)) >>> input_ph ```

object placeholder(TensorShape shape, Nullable<int> ndim, DType dtype, Nullable<bool> sparse, string name, Nullable<bool> ragged)

Instantiates a placeholder tensor and returns it.
Parameters
TensorShape shape
Shape of the placeholder (integer tuple, may include `None` entries).
Nullable<int> ndim
Number of axes of the tensor. At least one of {`shape`, `ndim`} must be specified. If both are specified, `shape` is used.
DType dtype
Placeholder type.
Nullable<bool> sparse
Boolean, whether the placeholder should have a sparse type.
string name
Optional name string for the placeholder.
Nullable<bool> ragged
Boolean, whether the placeholder should have a ragged type. In this case, values of 'None' in the 'shape' argument represent ragged dimensions. For more information about RaggedTensors, see this [guide](https://www.tensorflow.org/guide/ragged_tensors).
Returns
object
Tensor instance (with Keras metadata included).

Examples: ```python >>> from keras import backend as K >>> input_ph = K.placeholder(shape=(2, 4, 5)) >>> input_ph ```

object placeholder(PythonClassContainer shape, Nullable<int> ndim, DType dtype, Nullable<bool> sparse, string name, Nullable<bool> ragged)

Instantiates a placeholder tensor and returns it.
Parameters
PythonClassContainer shape
Shape of the placeholder (integer tuple, may include `None` entries).
Nullable<int> ndim
Number of axes of the tensor. At least one of {`shape`, `ndim`} must be specified. If both are specified, `shape` is used.
DType dtype
Placeholder type.
Nullable<bool> sparse
Boolean, whether the placeholder should have a sparse type.
string name
Optional name string for the placeholder.
Nullable<bool> ragged
Boolean, whether the placeholder should have a ragged type. In this case, values of 'None' in the 'shape' argument represent ragged dimensions. For more information about RaggedTensors, see this [guide](https://www.tensorflow.org/guide/ragged_tensors).
Returns
object
Tensor instance (with Keras metadata included).

Examples: ```python >>> from keras import backend as K >>> input_ph = K.placeholder(shape=(2, 4, 5)) >>> input_ph ```

object placeholder(PythonClassContainer shape, Nullable<int> ndim, dtype dtype, Nullable<bool> sparse, string name, Nullable<bool> ragged)

Instantiates a placeholder tensor and returns it.
Parameters
PythonClassContainer shape
Shape of the placeholder (integer tuple, may include `None` entries).
Nullable<int> ndim
Number of axes of the tensor. At least one of {`shape`, `ndim`} must be specified. If both are specified, `shape` is used.
dtype dtype
Placeholder type.
Nullable<bool> sparse
Boolean, whether the placeholder should have a sparse type.
string name
Optional name string for the placeholder.
Nullable<bool> ragged
Boolean, whether the placeholder should have a ragged type. In this case, values of 'None' in the 'shape' argument represent ragged dimensions. For more information about RaggedTensors, see this [guide](https://www.tensorflow.org/guide/ragged_tensors).
Returns
object
Tensor instance (with Keras metadata included).

Examples: ```python >>> from keras import backend as K >>> input_ph = K.placeholder(shape=(2, 4, 5)) >>> input_ph ```

object placeholder(PythonClassContainer shape, Nullable<int> ndim, PythonClassContainer dtype, Nullable<bool> sparse, string name, Nullable<bool> ragged)

Instantiates a placeholder tensor and returns it.
Parameters
PythonClassContainer shape
Shape of the placeholder (integer tuple, may include `None` entries).
Nullable<int> ndim
Number of axes of the tensor. At least one of {`shape`, `ndim`} must be specified. If both are specified, `shape` is used.
PythonClassContainer dtype
Placeholder type.
Nullable<bool> sparse
Boolean, whether the placeholder should have a sparse type.
string name
Optional name string for the placeholder.
Nullable<bool> ragged
Boolean, whether the placeholder should have a ragged type. In this case, values of 'None' in the 'shape' argument represent ragged dimensions. For more information about RaggedTensors, see this [guide](https://www.tensorflow.org/guide/ragged_tensors).
Returns
object
Tensor instance (with Keras metadata included).

Examples: ```python >>> from keras import backend as K >>> input_ph = K.placeholder(shape=(2, 4, 5)) >>> input_ph ```

object placeholder_dyn(object shape, object ndim, object dtype, ImplicitContainer<T> sparse, object name, ImplicitContainer<T> ragged)

Instantiates a placeholder tensor and returns it.
Parameters
object shape
Shape of the placeholder (integer tuple, may include `None` entries).
object ndim
Number of axes of the tensor. At least one of {`shape`, `ndim`} must be specified. If both are specified, `shape` is used.
object dtype
Placeholder type.
ImplicitContainer<T> sparse
Boolean, whether the placeholder should have a sparse type.
object name
Optional name string for the placeholder.
ImplicitContainer<T> ragged
Boolean, whether the placeholder should have a ragged type. In this case, values of 'None' in the 'shape' argument represent ragged dimensions. For more information about RaggedTensors, see this [guide](https://www.tensorflow.org/guide/ragged_tensors).
Returns
object
Tensor instance (with Keras metadata included).

Examples: ```python >>> from keras import backend as K >>> input_ph = K.placeholder(shape=(2, 4, 5)) >>> input_ph ```

object pool2d(IGraphNodeBase x, ValueTuple<int, object> pool_size, ValueTuple<int, object> strides, string padding, string data_format, string pool_mode)

2D Pooling.
Parameters
IGraphNodeBase x
Tensor or variable.
ValueTuple<int, object> pool_size
tuple of 2 integers.
ValueTuple<int, object> strides
tuple of 2 integers.
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
string pool_mode
string, `"max"` or `"avg"`.
Returns
object
A tensor, result of 2D pooling.

object pool2d_dyn(object x, object pool_size, ImplicitContainer<T> strides, ImplicitContainer<T> padding, object data_format, ImplicitContainer<T> pool_mode)

2D Pooling.
Parameters
object x
Tensor or variable.
object pool_size
tuple of 2 integers.
ImplicitContainer<T> strides
tuple of 2 integers.
ImplicitContainer<T> padding
string, `"same"` or `"valid"`.
object data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> pool_mode
string, `"max"` or `"avg"`.
Returns
object
A tensor, result of 2D pooling.

object pool3d(IGraphNodeBase x, ValueTuple<int, object, object> pool_size, ValueTuple<int, object, object> strides, string padding, string data_format, string pool_mode)

3D Pooling.
Parameters
IGraphNodeBase x
Tensor or variable.
ValueTuple<int, object, object> pool_size
tuple of 3 integers.
ValueTuple<int, object, object> strides
tuple of 3 integers.
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
string pool_mode
string, `"max"` or `"avg"`.
Returns
object
A tensor, result of 3D pooling.

object pool3d_dyn(object x, object pool_size, ImplicitContainer<T> strides, ImplicitContainer<T> padding, object data_format, ImplicitContainer<T> pool_mode)

3D Pooling.
Parameters
object x
Tensor or variable.
object pool_size
tuple of 3 integers.
ImplicitContainer<T> strides
tuple of 3 integers.
ImplicitContainer<T> padding
string, `"same"` or `"valid"`.
object data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> pool_mode
string, `"max"` or `"avg"`.
Returns
object
A tensor, result of 3D pooling.

object pow(IGraphNodeBase x, IGraphNodeBase a)

Element-wise exponentiation.
Parameters
IGraphNodeBase x
Tensor or variable.
IGraphNodeBase a
Python integer.
Returns
object
A tensor.

object pow(IGraphNodeBase x, int a)

Element-wise exponentiation.
Parameters
IGraphNodeBase x
Tensor or variable.
int a
Python integer.
Returns
object
A tensor.

object pow_dyn(object x, object a)

Element-wise exponentiation.
Parameters
object x
Tensor or variable.
object a
Python integer.
Returns
object
A tensor.

Tensor prod(object x, object axis, bool keepdims)

Multiplies the values in a tensor, alongside the specified axis.
Parameters
object x
A tensor or variable.
object axis
An integer, the axis to compute the product.
bool keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
Tensor
A tensor with the product of elements of `x`.

object prod_dyn(object x, object axis, ImplicitContainer<T> keepdims)

Multiplies the values in a tensor, alongside the specified axis.
Parameters
object x
A tensor or variable.
object axis
An integer, the axis to compute the product.
ImplicitContainer<T> keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
object
A tensor with the product of elements of `x`.

Tensor random_binomial(ValueTuple<int, object> shape, double p, DType dtype, object seed)

Returns a tensor with random binomial distribution of values.

The binomial distribution with parameters `n` and `p` is the probability distribution of the number of successful Bernoulli process. Only supports `n` = 1 for now.
Parameters
ValueTuple<int, object> shape
A tuple of integers, the shape of tensor to create.
double p
A float, `0. <= p <= 1`, probability of binomial distribution.
DType dtype
String, dtype of returned tensor.
object seed
Integer, random seed.
Returns
Tensor
A tensor.

object random_binomial_dyn(object shape, ImplicitContainer<T> p, object dtype, object seed)

Returns a tensor with random binomial distribution of values.

The binomial distribution with parameters `n` and `p` is the probability distribution of the number of successful Bernoulli process. Only supports `n` = 1 for now.
Parameters
object shape
A tuple of integers, the shape of tensor to create.
ImplicitContainer<T> p
A float, `0. <= p <= 1`, probability of binomial distribution.
object dtype
String, dtype of returned tensor.
object seed
Integer, random seed.
Returns
object
A tensor.

Tensor random_normal(ValueTuple<int, object> shape, double mean, double stddev, DType dtype, object seed)

Returns a tensor with normal distribution of values.
Parameters
ValueTuple<int, object> shape
A tuple of integers, the shape of tensor to create.
double mean
A float, mean of the normal distribution to draw samples.
double stddev
A float, standard deviation of the normal distribution to draw samples.
DType dtype
String, dtype of returned tensor.
object seed
Integer, random seed.
Returns
Tensor
A tensor.

Tensor random_normal(IGraphNodeBase shape, double mean, double stddev, DType dtype, object seed)

Returns a tensor with normal distribution of values.
Parameters
IGraphNodeBase shape
A tuple of integers, the shape of tensor to create.
double mean
A float, mean of the normal distribution to draw samples.
double stddev
A float, standard deviation of the normal distribution to draw samples.
DType dtype
String, dtype of returned tensor.
object seed
Integer, random seed.
Returns
Tensor
A tensor.

object random_normal_dyn(object shape, ImplicitContainer<T> mean, ImplicitContainer<T> stddev, object dtype, object seed)

Returns a tensor with normal distribution of values.
Parameters
object shape
A tuple of integers, the shape of tensor to create.
ImplicitContainer<T> mean
A float, mean of the normal distribution to draw samples.
ImplicitContainer<T> stddev
A float, standard deviation of the normal distribution to draw samples.
object dtype
String, dtype of returned tensor.
object seed
Integer, random seed.
Returns
object
A tensor.

object random_normal_variable(ValueTuple<int, int> shape, int mean, double scale, DType dtype, string name, Nullable<int> seed)

Instantiates a variable with values drawn from a normal distribution.
Parameters
ValueTuple<int, int> shape
Tuple of integers, shape of returned Keras variable.
int mean
Float, mean of the normal distribution.
double scale
Float, standard deviation of the normal distribution.
DType dtype
String, dtype of returned Keras variable.
string name
String, name of returned Keras variable.
Nullable<int> seed
Integer, random seed.
Returns
object
A Keras variable, filled with drawn samples.

Example: ```python # TensorFlow example >>> kvar = K.random_normal_variable((2,3), 0, 1) >>> kvar >>> K.eval(kvar) array([[ 1.19591331, 0.68685907, -0.63814116], [ 0.92629528, 0.28055015, 1.70484698]], dtype=float32) ```

object random_normal_variable(ValueTuple<int, int> shape, int mean, int scale, DType dtype, string name, Nullable<int> seed)

Instantiates a variable with values drawn from a normal distribution.
Parameters
ValueTuple<int, int> shape
Tuple of integers, shape of returned Keras variable.
int mean
Float, mean of the normal distribution.
int scale
Float, standard deviation of the normal distribution.
DType dtype
String, dtype of returned Keras variable.
string name
String, name of returned Keras variable.
Nullable<int> seed
Integer, random seed.
Returns
object
A Keras variable, filled with drawn samples.

Example: ```python # TensorFlow example >>> kvar = K.random_normal_variable((2,3), 0, 1) >>> kvar >>> K.eval(kvar) array([[ 1.19591331, 0.68685907, -0.63814116], [ 0.92629528, 0.28055015, 1.70484698]], dtype=float32) ```

object random_normal_variable(ValueTuple<int, int> shape, double mean, int scale, DType dtype, string name, Nullable<int> seed)

Instantiates a variable with values drawn from a normal distribution.
Parameters
ValueTuple<int, int> shape
Tuple of integers, shape of returned Keras variable.
double mean
Float, mean of the normal distribution.
int scale
Float, standard deviation of the normal distribution.
DType dtype
String, dtype of returned Keras variable.
string name
String, name of returned Keras variable.
Nullable<int> seed
Integer, random seed.
Returns
object
A Keras variable, filled with drawn samples.

Example: ```python # TensorFlow example >>> kvar = K.random_normal_variable((2,3), 0, 1) >>> kvar >>> K.eval(kvar) array([[ 1.19591331, 0.68685907, -0.63814116], [ 0.92629528, 0.28055015, 1.70484698]], dtype=float32) ```

object random_normal_variable(ValueTuple<int, int> shape, double mean, double scale, DType dtype, string name, Nullable<int> seed)

Instantiates a variable with values drawn from a normal distribution.
Parameters
ValueTuple<int, int> shape
Tuple of integers, shape of returned Keras variable.
double mean
Float, mean of the normal distribution.
double scale
Float, standard deviation of the normal distribution.
DType dtype
String, dtype of returned Keras variable.
string name
String, name of returned Keras variable.
Nullable<int> seed
Integer, random seed.
Returns
object
A Keras variable, filled with drawn samples.

Example: ```python # TensorFlow example >>> kvar = K.random_normal_variable((2,3), 0, 1) >>> kvar >>> K.eval(kvar) array([[ 1.19591331, 0.68685907, -0.63814116], [ 0.92629528, 0.28055015, 1.70484698]], dtype=float32) ```

object random_normal_variable_dyn(object shape, object mean, object scale, object dtype, object name, object seed)

Instantiates a variable with values drawn from a normal distribution.
Parameters
object shape
Tuple of integers, shape of returned Keras variable.
object mean
Float, mean of the normal distribution.
object scale
Float, standard deviation of the normal distribution.
object dtype
String, dtype of returned Keras variable.
object name
String, name of returned Keras variable.
object seed
Integer, random seed.
Returns
object
A Keras variable, filled with drawn samples.

Example: ```python # TensorFlow example >>> kvar = K.random_normal_variable((2,3), 0, 1) >>> kvar >>> K.eval(kvar) array([[ 1.19591331, 0.68685907, -0.63814116], [ 0.92629528, 0.28055015, 1.70484698]], dtype=float32) ```

Tensor random_uniform(Nullable<ValueTuple<int, object>> shape, double minval, double maxval, DType dtype, object seed)

Returns a tensor with uniform distribution of values.
Parameters
Nullable<ValueTuple<int, object>> shape
A tuple of integers, the shape of tensor to create.
double minval
A float, lower boundary of the uniform distribution to draw samples.
double maxval
A float, upper boundary of the uniform distribution to draw samples.
DType dtype
String, dtype of returned tensor.
object seed
Integer, random seed.
Returns
Tensor
A tensor.

object random_uniform_dyn(object shape, ImplicitContainer<T> minval, ImplicitContainer<T> maxval, object dtype, object seed)

Returns a tensor with uniform distribution of values.
Parameters
object shape
A tuple of integers, the shape of tensor to create.
ImplicitContainer<T> minval
A float, lower boundary of the uniform distribution to draw samples.
ImplicitContainer<T> maxval
A float, upper boundary of the uniform distribution to draw samples.
object dtype
String, dtype of returned tensor.
object seed
Integer, random seed.
Returns
object
A tensor.

object random_uniform_variable(ValueTuple<int, int> shape, int low, int high, DType dtype, string name, Nullable<int> seed)

Instantiates a variable with values drawn from a uniform distribution.
Parameters
ValueTuple<int, int> shape
Tuple of integers, shape of returned Keras variable.
int low
Float, lower boundary of the output interval.
int high
Float, upper boundary of the output interval.
DType dtype
String, dtype of returned Keras variable.
string name
String, name of returned Keras variable.
Nullable<int> seed
Integer, random seed.
Returns
object
A Keras variable, filled with drawn samples.

Example: ```python # TensorFlow example >>> kvar = K.random_uniform_variable((2,3), 0, 1) >>> kvar >>> K.eval(kvar) array([[ 0.10940075, 0.10047495, 0.476143 ], [ 0.66137183, 0.00869417, 0.89220798]], dtype=float32) ```

object random_uniform_variable_dyn(object shape, object low, object high, object dtype, object name, object seed)

Instantiates a variable with values drawn from a uniform distribution.
Parameters
object shape
Tuple of integers, shape of returned Keras variable.
object low
Float, lower boundary of the output interval.
object high
Float, upper boundary of the output interval.
object dtype
String, dtype of returned Keras variable.
object name
String, name of returned Keras variable.
object seed
Integer, random seed.
Returns
object
A Keras variable, filled with drawn samples.

Example: ```python # TensorFlow example >>> kvar = K.random_uniform_variable((2,3), 0, 1) >>> kvar >>> K.eval(kvar) array([[ 0.10940075, 0.10047495, 0.476143 ], [ 0.66137183, 0.00869417, 0.89220798]], dtype=float32) ```

object relu(IEnumerable<IGraphNodeBase> x, ndarray alpha, double max_value, int threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
double max_value
float. Saturation threshold.
int threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, double alpha, int max_value, ndarray threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
int max_value
float. Saturation threshold.
ndarray threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, double alpha, int max_value, double threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
int max_value
float. Saturation threshold.
double threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, ndarray alpha, double max_value, ndarray threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
double max_value
float. Saturation threshold.
ndarray threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, ndarray alpha, ndarray max_value, double threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
ndarray max_value
float. Saturation threshold.
double threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, ndarray alpha, double max_value, ndarray threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
double max_value
float. Saturation threshold.
ndarray threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, ndarray alpha, ndarray max_value, ndarray threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
ndarray max_value
float. Saturation threshold.
ndarray threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, double alpha, ndarray max_value, int threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
ndarray max_value
float. Saturation threshold.
int threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, ndarray alpha, double max_value, double threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
double max_value
float. Saturation threshold.
double threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, ndarray alpha, ndarray max_value, int threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
ndarray max_value
float. Saturation threshold.
int threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, ndarray alpha, double max_value, double threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
double max_value
float. Saturation threshold.
double threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, double alpha, int max_value, ndarray threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
int max_value
float. Saturation threshold.
ndarray threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, ndarray alpha, int max_value, ndarray threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
int max_value
float. Saturation threshold.
ndarray threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, double alpha, ndarray max_value, ndarray threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
ndarray max_value
float. Saturation threshold.
ndarray threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, ndarray alpha, int max_value, int threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
int max_value
float. Saturation threshold.
int threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, double alpha, ndarray max_value, int threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
ndarray max_value
float. Saturation threshold.
int threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, double alpha, ndarray max_value, double threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
ndarray max_value
float. Saturation threshold.
double threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, double alpha, double max_value, int threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
double max_value
float. Saturation threshold.
int threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, double alpha, double max_value, double threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
double max_value
float. Saturation threshold.
double threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, double alpha, ndarray max_value, ndarray threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
ndarray max_value
float. Saturation threshold.
ndarray threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, double alpha, ndarray max_value, double threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
ndarray max_value
float. Saturation threshold.
double threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, double alpha, double max_value, ndarray threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
double max_value
float. Saturation threshold.
ndarray threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, double alpha, int max_value, int threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
int max_value
float. Saturation threshold.
int threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, double alpha, int max_value, double threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
int max_value
float. Saturation threshold.
double threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, ndarray alpha, int max_value, double threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
int max_value
float. Saturation threshold.
double threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, ndarray alpha, ndarray max_value, double threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
ndarray max_value
float. Saturation threshold.
double threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, ndarray alpha, int max_value, double threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
int max_value
float. Saturation threshold.
double threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, ndarray alpha, ndarray max_value, int threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
ndarray max_value
float. Saturation threshold.
int threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, double alpha, double max_value, double threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
double max_value
float. Saturation threshold.
double threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, ndarray alpha, ndarray max_value, ndarray threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
ndarray max_value
float. Saturation threshold.
ndarray threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, double alpha, double max_value, ndarray threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
double max_value
float. Saturation threshold.
ndarray threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, ndarray alpha, int max_value, int threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
int max_value
float. Saturation threshold.
int threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, ndarray alpha, int max_value, ndarray threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
int max_value
float. Saturation threshold.
ndarray threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IEnumerable<IGraphNodeBase> x, double alpha, double max_value, int threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
double max_value
float. Saturation threshold.
int threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, double alpha, int max_value, int threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
double alpha
A scalar, slope of negative section (default=`0.`).
int max_value
float. Saturation threshold.
int threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

object relu(IGraphNodeBase x, ndarray alpha, double max_value, int threshold)

Rectified linear unit.

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows: `f(x) = max_value` for `x >= max_value`, `f(x) = x` for `threshold <= x < max_value`, `f(x) = alpha * (x - threshold)` otherwise.
Parameters
IGraphNodeBase x
A tensor or variable.
ndarray alpha
A scalar, slope of negative section (default=`0.`).
double max_value
float. Saturation threshold.
int threshold
float. Threshold value for thresholded activation.
Returns
object
A tensor.

Tensor repeat(IGraphNodeBase x, int n)

Repeats a 2D tensor.

if `x` has shape (samples, dim) and `n` is `2`, the output will have shape `(samples, 2, dim)`.
Parameters
IGraphNodeBase x
Tensor or variable.
int n
Python integer, number of times to repeat.
Returns
Tensor
A tensor.

Example: ```python >>> b = tf.constant([[1, 2], [3, 4]]) >>> b >>> tf.keras.backend.repeat(b, n=2) ```

Tensor repeat(IEnumerable<IGraphNodeBase> x, int n)

Repeats a 2D tensor.

if `x` has shape (samples, dim) and `n` is `2`, the output will have shape `(samples, 2, dim)`.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
int n
Python integer, number of times to repeat.
Returns
Tensor
A tensor.

Example: ```python >>> b = tf.constant([[1, 2], [3, 4]]) >>> b >>> tf.keras.backend.repeat(b, n=2) ```

object repeat_dyn(object x, object n)

Repeats a 2D tensor.

if `x` has shape (samples, dim) and `n` is `2`, the output will have shape `(samples, 2, dim)`.
Parameters
object x
Tensor or variable.
object n
Python integer, number of times to repeat.
Returns
object
A tensor.

Example: ```python >>> b = tf.constant([[1, 2], [3, 4]]) >>> b >>> tf.keras.backend.repeat(b, n=2) ```

object repeat_elements(IGraphNodeBase x, int rep, int axis)

Repeats the elements of a tensor along an axis, like `np.repeat`.

If `x` has shape `(s1, s2, s3)` and `axis` is `1`, the output will have shape `(s1, s2 * rep, s3)`.
Parameters
IGraphNodeBase x
Tensor or variable.
int rep
Python integer, number of times to repeat.
int axis
Axis along which to repeat.
Returns
object
A tensor.

Example: ```python >>> b = tf.constant([1, 2, 3]) >>> tf.keras.backend.repeat_elements(b, rep=2, axis=0) ```

object repeat_elements(IEnumerable<IGraphNodeBase> x, int rep, int axis)

Repeats the elements of a tensor along an axis, like `np.repeat`.

If `x` has shape `(s1, s2, s3)` and `axis` is `1`, the output will have shape `(s1, s2 * rep, s3)`.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
int rep
Python integer, number of times to repeat.
int axis
Axis along which to repeat.
Returns
object
A tensor.

Example: ```python >>> b = tf.constant([1, 2, 3]) >>> tf.keras.backend.repeat_elements(b, rep=2, axis=0) ```

object repeat_elements_dyn(object x, object rep, object axis)

Repeats the elements of a tensor along an axis, like `np.repeat`.

If `x` has shape `(s1, s2, s3)` and `axis` is `1`, the output will have shape `(s1, s2 * rep, s3)`.
Parameters
object x
Tensor or variable.
object rep
Python integer, number of times to repeat.
object axis
Axis along which to repeat.
Returns
object
A tensor.

Example: ```python >>> b = tf.constant([1, 2, 3]) >>> tf.keras.backend.repeat_elements(b, rep=2, axis=0) ```

void reset_uids()

Resets graph identifiers.

object reset_uids_dyn()

Resets graph identifiers.

Tensor reshape(object x, ValueTuple<object> shape)

Reshapes a tensor to the specified shape.
Parameters
object x
Tensor or variable.
ValueTuple<object> shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

Tensor reshape(object x, ValueTuple<int, int, object> shape)

Reshapes a tensor to the specified shape.
Parameters
object x
Tensor or variable.
ValueTuple<int, int, object> shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

Tensor reshape(IGraphNodeBase x, ValueTuple<object> shape)

Reshapes a tensor to the specified shape.
Parameters
IGraphNodeBase x
Tensor or variable.
ValueTuple<object> shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

Tensor reshape(IGraphNodeBase x, int shape)

Reshapes a tensor to the specified shape.
Parameters
IGraphNodeBase x
Tensor or variable.
int shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

Tensor reshape(IGraphNodeBase x, ValueTuple<int, int, object> shape)

Reshapes a tensor to the specified shape.
Parameters
IGraphNodeBase x
Tensor or variable.
ValueTuple<int, int, object> shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

Tensor reshape(IEnumerable<IGraphNodeBase> x, TensorShape shape)

Reshapes a tensor to the specified shape.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
TensorShape shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

Tensor reshape(IEnumerable<IGraphNodeBase> x, ValueTuple<object> shape)

Reshapes a tensor to the specified shape.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
ValueTuple<object> shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

Tensor reshape(IGraphNodeBase x, TensorShape shape)

Reshapes a tensor to the specified shape.
Parameters
IGraphNodeBase x
Tensor or variable.
TensorShape shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

Tensor reshape(object x, TensorShape shape)

Reshapes a tensor to the specified shape.
Parameters
object x
Tensor or variable.
TensorShape shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

Tensor reshape(PythonFunctionContainer x, TensorShape shape)

Reshapes a tensor to the specified shape.
Parameters
PythonFunctionContainer x
Tensor or variable.
TensorShape shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

Tensor reshape(PythonFunctionContainer x, ValueTuple<int, int, object> shape)

Reshapes a tensor to the specified shape.
Parameters
PythonFunctionContainer x
Tensor or variable.
ValueTuple<int, int, object> shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

Tensor reshape(object x, int shape)

Reshapes a tensor to the specified shape.
Parameters
object x
Tensor or variable.
int shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

Tensor reshape(PythonFunctionContainer x, int shape)

Reshapes a tensor to the specified shape.
Parameters
PythonFunctionContainer x
Tensor or variable.
int shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

Tensor reshape(IEnumerable<IGraphNodeBase> x, int shape)

Reshapes a tensor to the specified shape.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
int shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

Tensor reshape(IEnumerable<IGraphNodeBase> x, ValueTuple<int, int, object> shape)

Reshapes a tensor to the specified shape.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
ValueTuple<int, int, object> shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

Tensor reshape(PythonFunctionContainer x, ValueTuple<object> shape)

Reshapes a tensor to the specified shape.
Parameters
PythonFunctionContainer x
Tensor or variable.
ValueTuple<object> shape
Target shape tuple.
Returns
Tensor
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

object reshape_dyn(object x, object shape)

Reshapes a tensor to the specified shape.
Parameters
object x
Tensor or variable.
object shape
Target shape tuple.
Returns
object
A tensor.

Example: ```python >>> a = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) >>> a >>> tf.keras.backend.reshape(a, shape=(2, 6)) ```

object resize_images(IEnumerable<IGraphNodeBase> x, int height_factor, int width_factor, string data_format, string interpolation)

Resizes the images contained in a 4D tensor.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable to resize.
int height_factor
Positive integer.
int width_factor
Positive integer.
string data_format
One of `"channels_first"`, `"channels_last"`.
string interpolation
A string, one of `nearest` or `bilinear`.
Returns
object
A tensor.

object resize_images(IGraphNodeBase x, int height_factor, int width_factor, string data_format, string interpolation)

Resizes the images contained in a 4D tensor.
Parameters
IGraphNodeBase x
Tensor or variable to resize.
int height_factor
Positive integer.
int width_factor
Positive integer.
string data_format
One of `"channels_first"`, `"channels_last"`.
string interpolation
A string, one of `nearest` or `bilinear`.
Returns
object
A tensor.

object resize_images_dyn(object x, object height_factor, object width_factor, object data_format, ImplicitContainer<T> interpolation)

Resizes the images contained in a 4D tensor.
Parameters
object x
Tensor or variable to resize.
object height_factor
Positive integer.
object width_factor
Positive integer.
object data_format
One of `"channels_first"`, `"channels_last"`.
ImplicitContainer<T> interpolation
A string, one of `nearest` or `bilinear`.
Returns
object
A tensor.

object resize_volumes(IGraphNodeBase x, int depth_factor, int height_factor, int width_factor, string data_format)

Resizes the volume contained in a 5D tensor.
Parameters
IGraphNodeBase x
Tensor or variable to resize.
int depth_factor
Positive integer.
int height_factor
Positive integer.
int width_factor
Positive integer.
string data_format
One of `"channels_first"`, `"channels_last"`.
Returns
object
A tensor.

object resize_volumes(IEnumerable<IGraphNodeBase> x, int depth_factor, int height_factor, int width_factor, string data_format)

Resizes the volume contained in a 5D tensor.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable to resize.
int depth_factor
Positive integer.
int height_factor
Positive integer.
int width_factor
Positive integer.
string data_format
One of `"channels_first"`, `"channels_last"`.
Returns
object
A tensor.

object resize_volumes_dyn(object x, object depth_factor, object height_factor, object width_factor, object data_format)

Resizes the volume contained in a 5D tensor.
Parameters
object x
Tensor or variable to resize.
object depth_factor
Positive integer.
object height_factor
Positive integer.
object width_factor
Positive integer.
object data_format
One of `"channels_first"`, `"channels_last"`.
Returns
object
A tensor.

Tensor reverse(IEnumerable<IGraphNodeBase> x, int axes)

Reverse a tensor along the specified axes.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor to reverse.
int axes
Integer or iterable of integers. Axes to reverse.
Returns
Tensor
A tensor.

Tensor reverse(IndexedSlices x, int axes)

Reverse a tensor along the specified axes.
Parameters
IndexedSlices x
Tensor to reverse.
int axes
Integer or iterable of integers. Axes to reverse.
Returns
Tensor
A tensor.

Tensor reverse(ValueTuple<PythonClassContainer, PythonClassContainer> x, int axes)

Reverse a tensor along the specified axes.
Parameters
ValueTuple<PythonClassContainer, PythonClassContainer> x
Tensor to reverse.
int axes
Integer or iterable of integers. Axes to reverse.
Returns
Tensor
A tensor.

Tensor reverse(IGraphNodeBase x, int axes)

Reverse a tensor along the specified axes.
Parameters
IGraphNodeBase x
Tensor to reverse.
int axes
Integer or iterable of integers. Axes to reverse.
Returns
Tensor
A tensor.

object reverse_dyn(object x, object axes)

Reverse a tensor along the specified axes.
Parameters
object x
Tensor to reverse.
object axes
Integer or iterable of integers. Axes to reverse.
Returns
object
A tensor.

ValueTuple<object, object, object> rnn(PythonFunctionContainer step_function, IEnumerable<IGraphNodeBase> inputs, IEnumerable<IGraphNodeBase> initial_states, bool go_backwards, object mask, IEnumerable<IGraphNodeBase> constants, bool unroll, object input_length, bool time_major, ImplicitContainer<T> zero_output_for_mask)

Iterates over the time dimension of a tensor.
Parameters
PythonFunctionContainer step_function
RNN step function. Args; input; Tensor with shape `(samples,...)` (no time dimension), representing input for the batch of samples at a certain time step. states; List of tensors. Returns; output; Tensor with shape `(samples, output_dim)` (no time dimension). new_states; List of tensors, same length and shapes as 'states'. The first state in the list must be the output tensor at the previous timestep.
IEnumerable<IGraphNodeBase> inputs
Tensor of temporal data of shape `(samples, time,...)` (at least 3D), or nested tensors, and each of which has shape `(samples, time,...)`.
IEnumerable<IGraphNodeBase> initial_states
Tensor with shape `(samples, state_size)` (no time dimension), containing the initial values for the states used in the step function. In the case that state_size is in a nested shape, the shape of initial_states will also follow the nested structure.
bool go_backwards
Boolean. If True, do the iteration over the time dimension in reverse order and return the reversed sequence.
object mask
Binary tensor with shape `(samples, time, 1)`, with a zero for every element that is masked.
IEnumerable<IGraphNodeBase> constants
List of constant values passed at each step.
bool unroll
Whether to unroll the RNN or to use a symbolic `while_loop`.
object input_length
If specified, assume time dimension is of this length.
bool time_major
Boolean. If true, the inputs and outputs will be in shape `(timesteps, batch,...)`, whereas in the False case, it will be `(batch, timesteps,...)`. Using `time_major = True` is a bit more efficient because it avoids transposes at the beginning and end of the RNN calculation. However, most TensorFlow data is batch-major, so by default this function accepts input and emits output in batch-major form.
ImplicitContainer<T> zero_output_for_mask
Boolean. If True, the output for masked timestep will be zeros, whereas in the False case, output from previous timestep is returned.
Returns
ValueTuple<object, object, object>
A tuple, `(last_output, outputs, new_states)`. last_output: the latest output of the rnn, of shape `(samples,...)` outputs: tensor with shape `(samples, time,...)` where each entry `outputs[s, t]` is the output of the step function at time `t` for sample `s`. new_states: list of tensors, latest states returned by the step function, of shape `(samples,...)`.

ValueTuple<object, object, object> rnn(PythonFunctionContainer step_function, object inputs, object initial_states, bool go_backwards, object mask, IEnumerable<IGraphNodeBase> constants, bool unroll, object input_length, bool time_major, ImplicitContainer<T> zero_output_for_mask)

Iterates over the time dimension of a tensor.
Parameters
PythonFunctionContainer step_function
RNN step function. Args; input; Tensor with shape `(samples,...)` (no time dimension), representing input for the batch of samples at a certain time step. states; List of tensors. Returns; output; Tensor with shape `(samples, output_dim)` (no time dimension). new_states; List of tensors, same length and shapes as 'states'. The first state in the list must be the output tensor at the previous timestep.
object inputs
Tensor of temporal data of shape `(samples, time,...)` (at least 3D), or nested tensors, and each of which has shape `(samples, time,...)`.
object initial_states
Tensor with shape `(samples, state_size)` (no time dimension), containing the initial values for the states used in the step function. In the case that state_size is in a nested shape, the shape of initial_states will also follow the nested structure.
bool go_backwards
Boolean. If True, do the iteration over the time dimension in reverse order and return the reversed sequence.
object mask
Binary tensor with shape `(samples, time, 1)`, with a zero for every element that is masked.
IEnumerable<IGraphNodeBase> constants
List of constant values passed at each step.
bool unroll
Whether to unroll the RNN or to use a symbolic `while_loop`.
object input_length
If specified, assume time dimension is of this length.
bool time_major
Boolean. If true, the inputs and outputs will be in shape `(timesteps, batch,...)`, whereas in the False case, it will be `(batch, timesteps,...)`. Using `time_major = True` is a bit more efficient because it avoids transposes at the beginning and end of the RNN calculation. However, most TensorFlow data is batch-major, so by default this function accepts input and emits output in batch-major form.
ImplicitContainer<T> zero_output_for_mask
Boolean. If True, the output for masked timestep will be zeros, whereas in the False case, output from previous timestep is returned.
Returns
ValueTuple<object, object, object>
A tuple, `(last_output, outputs, new_states)`. last_output: the latest output of the rnn, of shape `(samples,...)` outputs: tensor with shape `(samples, time,...)` where each entry `outputs[s, t]` is the output of the step function at time `t` for sample `s`. new_states: list of tensors, latest states returned by the step function, of shape `(samples,...)`.

ValueTuple<object, object, object> rnn(PythonFunctionContainer step_function, IEnumerable<IGraphNodeBase> inputs, IEnumerable<IGraphNodeBase> initial_states, bool go_backwards, object mask, object constants, bool unroll, object input_length, bool time_major, ImplicitContainer<T> zero_output_for_mask)

Iterates over the time dimension of a tensor.
Parameters
PythonFunctionContainer step_function
RNN step function. Args; input; Tensor with shape `(samples,...)` (no time dimension), representing input for the batch of samples at a certain time step. states; List of tensors. Returns; output; Tensor with shape `(samples, output_dim)` (no time dimension). new_states; List of tensors, same length and shapes as 'states'. The first state in the list must be the output tensor at the previous timestep.
IEnumerable<IGraphNodeBase> inputs
Tensor of temporal data of shape `(samples, time,...)` (at least 3D), or nested tensors, and each of which has shape `(samples, time,...)`.
IEnumerable<IGraphNodeBase> initial_states
Tensor with shape `(samples, state_size)` (no time dimension), containing the initial values for the states used in the step function. In the case that state_size is in a nested shape, the shape of initial_states will also follow the nested structure.
bool go_backwards
Boolean. If True, do the iteration over the time dimension in reverse order and return the reversed sequence.
object mask
Binary tensor with shape `(samples, time, 1)`, with a zero for every element that is masked.
object constants
List of constant values passed at each step.
bool unroll
Whether to unroll the RNN or to use a symbolic `while_loop`.
object input_length
If specified, assume time dimension is of this length.
bool time_major
Boolean. If true, the inputs and outputs will be in shape `(timesteps, batch,...)`, whereas in the False case, it will be `(batch, timesteps,...)`. Using `time_major = True` is a bit more efficient because it avoids transposes at the beginning and end of the RNN calculation. However, most TensorFlow data is batch-major, so by default this function accepts input and emits output in batch-major form.
ImplicitContainer<T> zero_output_for_mask
Boolean. If True, the output for masked timestep will be zeros, whereas in the False case, output from previous timestep is returned.
Returns
ValueTuple<object, object, object>
A tuple, `(last_output, outputs, new_states)`. last_output: the latest output of the rnn, of shape `(samples,...)` outputs: tensor with shape `(samples, time,...)` where each entry `outputs[s, t]` is the output of the step function at time `t` for sample `s`. new_states: list of tensors, latest states returned by the step function, of shape `(samples,...)`.

ValueTuple<object, object, object> rnn(PythonFunctionContainer step_function, IEnumerable<IGraphNodeBase> inputs, PythonFunctionContainer initial_states, bool go_backwards, object mask, IEnumerable<IGraphNodeBase> constants, bool unroll, object input_length, bool time_major, ImplicitContainer<T> zero_output_for_mask)

Iterates over the time dimension of a tensor.
Parameters
PythonFunctionContainer step_function
RNN step function. Args; input; Tensor with shape `(samples,...)` (no time dimension), representing input for the batch of samples at a certain time step. states; List of tensors. Returns; output; Tensor with shape `(samples, output_dim)` (no time dimension). new_states; List of tensors, same length and shapes as 'states'. The first state in the list must be the output tensor at the previous timestep.
IEnumerable<IGraphNodeBase> inputs
Tensor of temporal data of shape `(samples, time,...)` (at least 3D), or nested tensors, and each of which has shape `(samples, time,...)`.
PythonFunctionContainer initial_states
Tensor with shape `(samples, state_size)` (no time dimension), containing the initial values for the states used in the step function. In the case that state_size is in a nested shape, the shape of initial_states will also follow the nested structure.
bool go_backwards
Boolean. If True, do the iteration over the time dimension in reverse order and return the reversed sequence.
object mask
Binary tensor with shape `(samples, time, 1)`, with a zero for every element that is masked.
IEnumerable<IGraphNodeBase> constants
List of constant values passed at each step.
bool unroll
Whether to unroll the RNN or to use a symbolic `while_loop`.
object input_length
If specified, assume time dimension is of this length.
bool time_major
Boolean. If true, the inputs and outputs will be in shape `(timesteps, batch,...)`, whereas in the False case, it will be `(batch, timesteps,...)`. Using `time_major = True` is a bit more efficient because it avoids transposes at the beginning and end of the RNN calculation. However, most TensorFlow data is batch-major, so by default this function accepts input and emits output in batch-major form.
ImplicitContainer<T> zero_output_for_mask
Boolean. If True, the output for masked timestep will be zeros, whereas in the False case, output from previous timestep is returned.
Returns
ValueTuple<object, object, object>
A tuple, `(last_output, outputs, new_states)`. last_output: the latest output of the rnn, of shape `(samples,...)` outputs: tensor with shape `(samples, time,...)` where each entry `outputs[s, t]` is the output of the step function at time `t` for sample `s`. new_states: list of tensors, latest states returned by the step function, of shape `(samples,...)`.

ValueTuple<object, object, object> rnn(PythonFunctionContainer step_function, IEnumerable<IGraphNodeBase> inputs, PythonFunctionContainer initial_states, bool go_backwards, object mask, object constants, bool unroll, object input_length, bool time_major, ImplicitContainer<T> zero_output_for_mask)

Iterates over the time dimension of a tensor.
Parameters
PythonFunctionContainer step_function
RNN step function. Args; input; Tensor with shape `(samples,...)` (no time dimension), representing input for the batch of samples at a certain time step. states; List of tensors. Returns; output; Tensor with shape `(samples, output_dim)` (no time dimension). new_states; List of tensors, same length and shapes as 'states'. The first state in the list must be the output tensor at the previous timestep.
IEnumerable<IGraphNodeBase> inputs
Tensor of temporal data of shape `(samples, time,...)` (at least 3D), or nested tensors, and each of which has shape `(samples, time,...)`.
PythonFunctionContainer initial_states
Tensor with shape `(samples, state_size)` (no time dimension), containing the initial values for the states used in the step function. In the case that state_size is in a nested shape, the shape of initial_states will also follow the nested structure.
bool go_backwards
Boolean. If True, do the iteration over the time dimension in reverse order and return the reversed sequence.
object mask
Binary tensor with shape `(samples, time, 1)`, with a zero for every element that is masked.
object constants
List of constant values passed at each step.
bool unroll
Whether to unroll the RNN or to use a symbolic `while_loop`.
object input_length
If specified, assume time dimension is of this length.
bool time_major
Boolean. If true, the inputs and outputs will be in shape `(timesteps, batch,...)`, whereas in the False case, it will be `(batch, timesteps,...)`. Using `time_major = True` is a bit more efficient because it avoids transposes at the beginning and end of the RNN calculation. However, most TensorFlow data is batch-major, so by default this function accepts input and emits output in batch-major form.
ImplicitContainer<T> zero_output_for_mask
Boolean. If True, the output for masked timestep will be zeros, whereas in the False case, output from previous timestep is returned.
Returns
ValueTuple<object, object, object>
A tuple, `(last_output, outputs, new_states)`. last_output: the latest output of the rnn, of shape `(samples,...)` outputs: tensor with shape `(samples, time,...)` where each entry `outputs[s, t]` is the output of the step function at time `t` for sample `s`. new_states: list of tensors, latest states returned by the step function, of shape `(samples,...)`.

ValueTuple<object, object, object> rnn(PythonFunctionContainer step_function, IEnumerable<IGraphNodeBase> inputs, object initial_states, bool go_backwards, object mask, IEnumerable<IGraphNodeBase> constants, bool unroll, object input_length, bool time_major, ImplicitContainer<T> zero_output_for_mask)

Iterates over the time dimension of a tensor.
Parameters
PythonFunctionContainer step_function
RNN step function. Args; input; Tensor with shape `(samples,...)` (no time dimension), representing input for the batch of samples at a certain time step. states; List of tensors. Returns; output; Tensor with shape `(samples, output_dim)` (no time dimension). new_states; List of tensors, same length and shapes as 'states'. The first state in the list must be the output tensor at the previous timestep.
IEnumerable<IGraphNodeBase> inputs
Tensor of temporal data of shape `(samples, time,...)` (at least 3D), or nested tensors, and each of which has shape `(samples, time,...)`.
object initial_states
Tensor with shape `(samples, state_size)` (no time dimension), containing the initial values for the states used in the step function. In the case that state_size is in a nested shape, the shape of initial_states will also follow the nested structure.
bool go_backwards
Boolean. If True, do the iteration over the time dimension in reverse order and return the reversed sequence.
object mask
Binary tensor with shape `(samples, time, 1)`, with a zero for every element that is masked.
IEnumerable<IGraphNodeBase> constants
List of constant values passed at each step.
bool unroll
Whether to unroll the RNN or to use a symbolic `while_loop`.
object input_length
If specified, assume time dimension is of this length.
bool time_major
Boolean. If true, the inputs and outputs will be in shape `(timesteps, batch,...)`, whereas in the False case, it will be `(batch, timesteps,...)`. Using `time_major = True` is a bit more efficient because it avoids transposes at the beginning and end of the RNN calculation. However, most TensorFlow data is batch-major, so by default this function accepts input and emits output in batch-major form.
ImplicitContainer<T> zero_output_for_mask
Boolean. If True, the output for masked timestep will be zeros, whereas in the False case, output from previous timestep is returned.
Returns
ValueTuple<object, object, object>
A tuple, `(last_output, outputs, new_states)`. last_output: the latest output of the rnn, of shape `(samples,...)` outputs: tensor with shape `(samples, time,...)` where each entry `outputs[s, t]` is the output of the step function at time `t` for sample `s`. new_states: list of tensors, latest states returned by the step function, of shape `(samples,...)`.

ValueTuple<object, object, object> rnn(PythonFunctionContainer step_function, IEnumerable<IGraphNodeBase> inputs, object initial_states, bool go_backwards, object mask, object constants, bool unroll, object input_length, bool time_major, ImplicitContainer<T> zero_output_for_mask)

Iterates over the time dimension of a tensor.
Parameters
PythonFunctionContainer step_function
RNN step function. Args; input; Tensor with shape `(samples,...)` (no time dimension), representing input for the batch of samples at a certain time step. states; List of tensors. Returns; output; Tensor with shape `(samples, output_dim)` (no time dimension). new_states; List of tensors, same length and shapes as 'states'. The first state in the list must be the output tensor at the previous timestep.
IEnumerable<IGraphNodeBase> inputs
Tensor of temporal data of shape `(samples, time,...)` (at least 3D), or nested tensors, and each of which has shape `(samples, time,...)`.
object initial_states
Tensor with shape `(samples, state_size)` (no time dimension), containing the initial values for the states used in the step function. In the case that state_size is in a nested shape, the shape of initial_states will also follow the nested structure.
bool go_backwards
Boolean. If True, do the iteration over the time dimension in reverse order and return the reversed sequence.
object mask
Binary tensor with shape `(samples, time, 1)`, with a zero for every element that is masked.
object constants
List of constant values passed at each step.
bool unroll
Whether to unroll the RNN or to use a symbolic `while_loop`.
object input_length
If specified, assume time dimension is of this length.
bool time_major
Boolean. If true, the inputs and outputs will be in shape `(timesteps, batch,...)`, whereas in the False case, it will be `(batch, timesteps,...)`. Using `time_major = True` is a bit more efficient because it avoids transposes at the beginning and end of the RNN calculation. However, most TensorFlow data is batch-major, so by default this function accepts input and emits output in batch-major form.
ImplicitContainer<T> zero_output_for_mask
Boolean. If True, the output for masked timestep will be zeros, whereas in the False case, output from previous timestep is returned.
Returns
ValueTuple<object, object, object>
A tuple, `(last_output, outputs, new_states)`. last_output: the latest output of the rnn, of shape `(samples,...)` outputs: tensor with shape `(samples, time,...)` where each entry `outputs[s, t]` is the output of the step function at time `t` for sample `s`. new_states: list of tensors, latest states returned by the step function, of shape `(samples,...)`.

ValueTuple<object, object, object> rnn(PythonFunctionContainer step_function, object inputs, IEnumerable<IGraphNodeBase> initial_states, bool go_backwards, object mask, IEnumerable<IGraphNodeBase> constants, bool unroll, object input_length, bool time_major, ImplicitContainer<T> zero_output_for_mask)

Iterates over the time dimension of a tensor.
Parameters
PythonFunctionContainer step_function
RNN step function. Args; input; Tensor with shape `(samples,...)` (no time dimension), representing input for the batch of samples at a certain time step. states; List of tensors. Returns; output; Tensor with shape `(samples, output_dim)` (no time dimension). new_states; List of tensors, same length and shapes as 'states'. The first state in the list must be the output tensor at the previous timestep.
object inputs
Tensor of temporal data of shape `(samples, time,...)` (at least 3D), or nested tensors, and each of which has shape `(samples, time,...)`.
IEnumerable<IGraphNodeBase> initial_states
Tensor with shape `(samples, state_size)` (no time dimension), containing the initial values for the states used in the step function. In the case that state_size is in a nested shape, the shape of initial_states will also follow the nested structure.
bool go_backwards
Boolean. If True, do the iteration over the time dimension in reverse order and return the reversed sequence.
object mask
Binary tensor with shape `(samples, time, 1)`, with a zero for every element that is masked.
IEnumerable<IGraphNodeBase> constants
List of constant values passed at each step.
bool unroll
Whether to unroll the RNN or to use a symbolic `while_loop`.
object input_length
If specified, assume time dimension is of this length.
bool time_major
Boolean. If true, the inputs and outputs will be in shape `(timesteps, batch,...)`, whereas in the False case, it will be `(batch, timesteps,...)`. Using `time_major = True` is a bit more efficient because it avoids transposes at the beginning and end of the RNN calculation. However, most TensorFlow data is batch-major, so by default this function accepts input and emits output in batch-major form.
ImplicitContainer<T> zero_output_for_mask
Boolean. If True, the output for masked timestep will be zeros, whereas in the False case, output from previous timestep is returned.
Returns
ValueTuple<object, object, object>
A tuple, `(last_output, outputs, new_states)`. last_output: the latest output of the rnn, of shape `(samples,...)` outputs: tensor with shape `(samples, time,...)` where each entry `outputs[s, t]` is the output of the step function at time `t` for sample `s`. new_states: list of tensors, latest states returned by the step function, of shape `(samples,...)`.

ValueTuple<object, object, object> rnn(PythonFunctionContainer step_function, object inputs, object initial_states, bool go_backwards, object mask, object constants, bool unroll, object input_length, bool time_major, ImplicitContainer<T> zero_output_for_mask)

Iterates over the time dimension of a tensor.
Parameters
PythonFunctionContainer step_function
RNN step function. Args; input; Tensor with shape `(samples,...)` (no time dimension), representing input for the batch of samples at a certain time step. states; List of tensors. Returns; output; Tensor with shape `(samples, output_dim)` (no time dimension). new_states; List of tensors, same length and shapes as 'states'. The first state in the list must be the output tensor at the previous timestep.
object inputs
Tensor of temporal data of shape `(samples, time,...)` (at least 3D), or nested tensors, and each of which has shape `(samples, time,...)`.
object initial_states
Tensor with shape `(samples, state_size)` (no time dimension), containing the initial values for the states used in the step function. In the case that state_size is in a nested shape, the shape of initial_states will also follow the nested structure.
bool go_backwards
Boolean. If True, do the iteration over the time dimension in reverse order and return the reversed sequence.
object mask
Binary tensor with shape `(samples, time, 1)`, with a zero for every element that is masked.
object constants
List of constant values passed at each step.
bool unroll
Whether to unroll the RNN or to use a symbolic `while_loop`.
object input_length
If specified, assume time dimension is of this length.
bool time_major
Boolean. If true, the inputs and outputs will be in shape `(timesteps, batch,...)`, whereas in the False case, it will be `(batch, timesteps,...)`. Using `time_major = True` is a bit more efficient because it avoids transposes at the beginning and end of the RNN calculation. However, most TensorFlow data is batch-major, so by default this function accepts input and emits output in batch-major form.
ImplicitContainer<T> zero_output_for_mask
Boolean. If True, the output for masked timestep will be zeros, whereas in the False case, output from previous timestep is returned.
Returns
ValueTuple<object, object, object>
A tuple, `(last_output, outputs, new_states)`. last_output: the latest output of the rnn, of shape `(samples,...)` outputs: tensor with shape `(samples, time,...)` where each entry `outputs[s, t]` is the output of the step function at time `t` for sample `s`. new_states: list of tensors, latest states returned by the step function, of shape `(samples,...)`.

ValueTuple<object, object, object> rnn(PythonFunctionContainer step_function, object inputs, IEnumerable<IGraphNodeBase> initial_states, bool go_backwards, object mask, object constants, bool unroll, object input_length, bool time_major, ImplicitContainer<T> zero_output_for_mask)

Iterates over the time dimension of a tensor.
Parameters
PythonFunctionContainer step_function
RNN step function. Args; input; Tensor with shape `(samples,...)` (no time dimension), representing input for the batch of samples at a certain time step. states; List of tensors. Returns; output; Tensor with shape `(samples, output_dim)` (no time dimension). new_states; List of tensors, same length and shapes as 'states'. The first state in the list must be the output tensor at the previous timestep.
object inputs
Tensor of temporal data of shape `(samples, time,...)` (at least 3D), or nested tensors, and each of which has shape `(samples, time,...)`.
IEnumerable<IGraphNodeBase> initial_states
Tensor with shape `(samples, state_size)` (no time dimension), containing the initial values for the states used in the step function. In the case that state_size is in a nested shape, the shape of initial_states will also follow the nested structure.
bool go_backwards
Boolean. If True, do the iteration over the time dimension in reverse order and return the reversed sequence.
object mask
Binary tensor with shape `(samples, time, 1)`, with a zero for every element that is masked.
object constants
List of constant values passed at each step.
bool unroll
Whether to unroll the RNN or to use a symbolic `while_loop`.
object input_length
If specified, assume time dimension is of this length.
bool time_major
Boolean. If true, the inputs and outputs will be in shape `(timesteps, batch,...)`, whereas in the False case, it will be `(batch, timesteps,...)`. Using `time_major = True` is a bit more efficient because it avoids transposes at the beginning and end of the RNN calculation. However, most TensorFlow data is batch-major, so by default this function accepts input and emits output in batch-major form.
ImplicitContainer<T> zero_output_for_mask
Boolean. If True, the output for masked timestep will be zeros, whereas in the False case, output from previous timestep is returned.
Returns
ValueTuple<object, object, object>
A tuple, `(last_output, outputs, new_states)`. last_output: the latest output of the rnn, of shape `(samples,...)` outputs: tensor with shape `(samples, time,...)` where each entry `outputs[s, t]` is the output of the step function at time `t` for sample `s`. new_states: list of tensors, latest states returned by the step function, of shape `(samples,...)`.

ValueTuple<object, object, object> rnn(PythonFunctionContainer step_function, object inputs, PythonFunctionContainer initial_states, bool go_backwards, object mask, object constants, bool unroll, object input_length, bool time_major, ImplicitContainer<T> zero_output_for_mask)

Iterates over the time dimension of a tensor.
Parameters
PythonFunctionContainer step_function
RNN step function. Args; input; Tensor with shape `(samples,...)` (no time dimension), representing input for the batch of samples at a certain time step. states; List of tensors. Returns; output; Tensor with shape `(samples, output_dim)` (no time dimension). new_states; List of tensors, same length and shapes as 'states'. The first state in the list must be the output tensor at the previous timestep.
object inputs
Tensor of temporal data of shape `(samples, time,...)` (at least 3D), or nested tensors, and each of which has shape `(samples, time,...)`.
PythonFunctionContainer initial_states
Tensor with shape `(samples, state_size)` (no time dimension), containing the initial values for the states used in the step function. In the case that state_size is in a nested shape, the shape of initial_states will also follow the nested structure.
bool go_backwards
Boolean. If True, do the iteration over the time dimension in reverse order and return the reversed sequence.
object mask
Binary tensor with shape `(samples, time, 1)`, with a zero for every element that is masked.
object constants
List of constant values passed at each step.
bool unroll
Whether to unroll the RNN or to use a symbolic `while_loop`.
object input_length
If specified, assume time dimension is of this length.
bool time_major
Boolean. If true, the inputs and outputs will be in shape `(timesteps, batch,...)`, whereas in the False case, it will be `(batch, timesteps,...)`. Using `time_major = True` is a bit more efficient because it avoids transposes at the beginning and end of the RNN calculation. However, most TensorFlow data is batch-major, so by default this function accepts input and emits output in batch-major form.
ImplicitContainer<T> zero_output_for_mask
Boolean. If True, the output for masked timestep will be zeros, whereas in the False case, output from previous timestep is returned.
Returns
ValueTuple<object, object, object>
A tuple, `(last_output, outputs, new_states)`. last_output: the latest output of the rnn, of shape `(samples,...)` outputs: tensor with shape `(samples, time,...)` where each entry `outputs[s, t]` is the output of the step function at time `t` for sample `s`. new_states: list of tensors, latest states returned by the step function, of shape `(samples,...)`.

ValueTuple<object, object, object> rnn(PythonFunctionContainer step_function, object inputs, PythonFunctionContainer initial_states, bool go_backwards, object mask, IEnumerable<IGraphNodeBase> constants, bool unroll, object input_length, bool time_major, ImplicitContainer<T> zero_output_for_mask)

Iterates over the time dimension of a tensor.
Parameters
PythonFunctionContainer step_function
RNN step function. Args; input; Tensor with shape `(samples,...)` (no time dimension), representing input for the batch of samples at a certain time step. states; List of tensors. Returns; output; Tensor with shape `(samples, output_dim)` (no time dimension). new_states; List of tensors, same length and shapes as 'states'. The first state in the list must be the output tensor at the previous timestep.
object inputs
Tensor of temporal data of shape `(samples, time,...)` (at least 3D), or nested tensors, and each of which has shape `(samples, time,...)`.
PythonFunctionContainer initial_states
Tensor with shape `(samples, state_size)` (no time dimension), containing the initial values for the states used in the step function. In the case that state_size is in a nested shape, the shape of initial_states will also follow the nested structure.
bool go_backwards
Boolean. If True, do the iteration over the time dimension in reverse order and return the reversed sequence.
object mask
Binary tensor with shape `(samples, time, 1)`, with a zero for every element that is masked.
IEnumerable<IGraphNodeBase> constants
List of constant values passed at each step.
bool unroll
Whether to unroll the RNN or to use a symbolic `while_loop`.
object input_length
If specified, assume time dimension is of this length.
bool time_major
Boolean. If true, the inputs and outputs will be in shape `(timesteps, batch,...)`, whereas in the False case, it will be `(batch, timesteps,...)`. Using `time_major = True` is a bit more efficient because it avoids transposes at the beginning and end of the RNN calculation. However, most TensorFlow data is batch-major, so by default this function accepts input and emits output in batch-major form.
ImplicitContainer<T> zero_output_for_mask
Boolean. If True, the output for masked timestep will be zeros, whereas in the False case, output from previous timestep is returned.
Returns
ValueTuple<object, object, object>
A tuple, `(last_output, outputs, new_states)`. last_output: the latest output of the rnn, of shape `(samples,...)` outputs: tensor with shape `(samples, time,...)` where each entry `outputs[s, t]` is the output of the step function at time `t` for sample `s`. new_states: list of tensors, latest states returned by the step function, of shape `(samples,...)`.

object rnn_dyn(object step_function, object inputs, object initial_states, ImplicitContainer<T> go_backwards, object mask, object constants, ImplicitContainer<T> unroll, object input_length, ImplicitContainer<T> time_major, ImplicitContainer<T> zero_output_for_mask)

Iterates over the time dimension of a tensor.
Parameters
object step_function
RNN step function. Args; input; Tensor with shape `(samples,...)` (no time dimension), representing input for the batch of samples at a certain time step. states; List of tensors. Returns; output; Tensor with shape `(samples, output_dim)` (no time dimension). new_states; List of tensors, same length and shapes as 'states'. The first state in the list must be the output tensor at the previous timestep.
object inputs
Tensor of temporal data of shape `(samples, time,...)` (at least 3D), or nested tensors, and each of which has shape `(samples, time,...)`.
object initial_states
Tensor with shape `(samples, state_size)` (no time dimension), containing the initial values for the states used in the step function. In the case that state_size is in a nested shape, the shape of initial_states will also follow the nested structure.
ImplicitContainer<T> go_backwards
Boolean. If True, do the iteration over the time dimension in reverse order and return the reversed sequence.
object mask
Binary tensor with shape `(samples, time, 1)`, with a zero for every element that is masked.
object constants
List of constant values passed at each step.
ImplicitContainer<T> unroll
Whether to unroll the RNN or to use a symbolic `while_loop`.
object input_length
If specified, assume time dimension is of this length.
ImplicitContainer<T> time_major
Boolean. If true, the inputs and outputs will be in shape `(timesteps, batch,...)`, whereas in the False case, it will be `(batch, timesteps,...)`. Using `time_major = True` is a bit more efficient because it avoids transposes at the beginning and end of the RNN calculation. However, most TensorFlow data is batch-major, so by default this function accepts input and emits output in batch-major form.
ImplicitContainer<T> zero_output_for_mask
Boolean. If True, the output for masked timestep will be zeros, whereas in the False case, output from previous timestep is returned.
Returns
object
A tuple, `(last_output, outputs, new_states)`. last_output: the latest output of the rnn, of shape `(samples,...)` outputs: tensor with shape `(samples, time,...)` where each entry `outputs[s, t]` is the output of the step function at time `t` for sample `s`. new_states: list of tensors, latest states returned by the step function, of shape `(samples,...)`.

object round(object x)

Element-wise rounding to the closest integer.

In case of tie, the rounding mode used is "half to even".
Parameters
object x
Tensor or variable.
Returns
object
A tensor.

object round_dyn(object x)

Element-wise rounding to the closest integer.

In case of tie, the rounding mode used is "half to even".
Parameters
object x
Tensor or variable.
Returns
object
A tensor.

object separable_conv2d(IGraphNodeBase x, IGraphNodeBase depthwise_kernel, IGraphNodeBase pointwise_kernel, ValueTuple<int, object> strides, string padding, string data_format, ValueTuple<int, object> dilation_rate)

2D convolution with separable filters.
Parameters
IGraphNodeBase x
input tensor
IGraphNodeBase depthwise_kernel
convolution kernel for the depthwise convolution.
IGraphNodeBase pointwise_kernel
kernel for the 1x1 convolution.
ValueTuple<int, object> strides
strides tuple (length 2).
string padding
string, `"same"` or `"valid"`.
string data_format
string, `"channels_last"` or `"channels_first"`.
ValueTuple<int, object> dilation_rate
tuple of integers, dilation rates for the separable convolution.
Returns
object
Output tensor.

object separable_conv2d_dyn(object x, object depthwise_kernel, object pointwise_kernel, ImplicitContainer<T> strides, ImplicitContainer<T> padding, object data_format, ImplicitContainer<T> dilation_rate)

2D convolution with separable filters.
Parameters
object x
input tensor
object depthwise_kernel
convolution kernel for the depthwise convolution.
object pointwise_kernel
kernel for the 1x1 convolution.
ImplicitContainer<T> strides
strides tuple (length 2).
ImplicitContainer<T> padding
string, `"same"` or `"valid"`.
object data_format
string, `"channels_last"` or `"channels_first"`.
ImplicitContainer<T> dilation_rate
tuple of integers, dilation rates for the separable convolution.
Returns
object
Output tensor.

void set_epsilon(double value)

Sets the value of the fuzz factor used in numeric expressions.
Parameters
double value
float. New value of epsilon. Example: ```python from keras import backend as K K.epsilon() >>> 1e-07 K.set_epsilon(1e-05) K.epsilon() >>> 1e-05 ```

object set_epsilon_dyn(object value)

Sets the value of the fuzz factor used in numeric expressions.
Parameters
object value
float. New value of epsilon. Example: ```python from keras import backend as K K.epsilon() >>> 1e-07 K.set_epsilon(1e-05) K.epsilon() >>> 1e-05 ```

void set_floatx(string value)

Sets the default float type.
Parameters
string value
String; 'float16', 'float32', or 'float64'. Example: ```python from keras import backend as K K.floatx() >>> 'float32' K.set_floatx('float16') K.floatx() >>> 'float16' ```

object set_floatx_dyn(object value)

Sets the default float type.
Parameters
object value
String; 'float16', 'float32', or 'float64'. Example: ```python from keras import backend as K K.floatx() >>> 'float32' K.set_floatx('float16') K.floatx() >>> 'float16' ```

void set_image_data_format(string data_format)

Sets the value of the image data format convention.
Parameters
string data_format
string. `'channels_first'` or `'channels_last'`. Example: ```python from keras import backend as K K.image_data_format() >>> 'channels_first' K.set_image_data_format('channels_last') K.image_data_format() >>> 'channels_last' ```

object set_image_data_format_dyn(object data_format)

Sets the value of the image data format convention.
Parameters
object data_format
string. `'channels_first'` or `'channels_last'`. Example: ```python from keras import backend as K K.image_data_format() >>> 'channels_first' K.set_image_data_format('channels_last') K.image_data_format() >>> 'channels_last' ```

void set_learning_phase(Nullable<int> value)

Sets the learning phase to a fixed value.
Parameters
Nullable<int> value
Learning phase value, either 0 or 1 (integers).

void set_learning_phase(bool value)

Sets the learning phase to a fixed value.
Parameters
bool value
Learning phase value, either 0 or 1 (integers).

object set_learning_phase_dyn(object value)

Sets the learning phase to a fixed value.
Parameters
object value
Learning phase value, either 0 or 1 (integers).

void set_session(LocalCLIDebugWrapperSession session)

Sets the global TensorFlow session.
Parameters
LocalCLIDebugWrapperSession session
A TF Session.

void set_session(Session session)

Sets the global TensorFlow session.
Parameters
Session session
A TF Session.

object set_session_dyn(object session)

Sets the global TensorFlow session.
Parameters
object session
A TF Session.

void set_value(ReplicatedVariable x, object value)

Sets the value of a variable, from a Numpy array.
Parameters
ReplicatedVariable x
Tensor to set to a new value.
object value
Value to set the tensor to, as a Numpy array (of the same shape).

void set_value(ResourceVariable x, PythonFunctionContainer value)

Sets the value of a variable, from a Numpy array.
Parameters
ResourceVariable x
Tensor to set to a new value.
PythonFunctionContainer value
Value to set the tensor to, as a Numpy array (of the same shape).

void set_value(_ArrayLike x, PythonFunctionContainer value)

Sets the value of a variable, from a Numpy array.
Parameters
_ArrayLike x
Tensor to set to a new value.
PythonFunctionContainer value
Value to set the tensor to, as a Numpy array (of the same shape).

void set_value(IGraphNodeBase x, object value)

Sets the value of a variable, from a Numpy array.
Parameters
IGraphNodeBase x
Tensor to set to a new value.
object value
Value to set the tensor to, as a Numpy array (of the same shape).

void set_value(ValueTuple<PythonClassContainer, PythonClassContainer> x, object value)

Sets the value of a variable, from a Numpy array.
Parameters
ValueTuple<PythonClassContainer, PythonClassContainer> x
Tensor to set to a new value.
object value
Value to set the tensor to, as a Numpy array (of the same shape).

void set_value(ValueTuple<PythonClassContainer, PythonClassContainer> x, PythonFunctionContainer value)

Sets the value of a variable, from a Numpy array.
Parameters
ValueTuple<PythonClassContainer, PythonClassContainer> x
Tensor to set to a new value.
PythonFunctionContainer value
Value to set the tensor to, as a Numpy array (of the same shape).

void set_value(Trackable x, PythonFunctionContainer value)

Sets the value of a variable, from a Numpy array.
Parameters
Trackable x
Tensor to set to a new value.
PythonFunctionContainer value
Value to set the tensor to, as a Numpy array (of the same shape).

void set_value(Trackable x, object value)

Sets the value of a variable, from a Numpy array.
Parameters
Trackable x
Tensor to set to a new value.
object value
Value to set the tensor to, as a Numpy array (of the same shape).

void set_value(IGraphNodeBase x, PythonFunctionContainer value)

Sets the value of a variable, from a Numpy array.
Parameters
IGraphNodeBase x
Tensor to set to a new value.
PythonFunctionContainer value
Value to set the tensor to, as a Numpy array (of the same shape).

void set_value(ndarray x, object value)

Sets the value of a variable, from a Numpy array.
Parameters
ndarray x
Tensor to set to a new value.
object value
Value to set the tensor to, as a Numpy array (of the same shape).

void set_value(ReplicatedVariable x, PythonFunctionContainer value)

Sets the value of a variable, from a Numpy array.
Parameters
ReplicatedVariable x
Tensor to set to a new value.
PythonFunctionContainer value
Value to set the tensor to, as a Numpy array (of the same shape).

void set_value(ResourceVariable x, object value)

Sets the value of a variable, from a Numpy array.
Parameters
ResourceVariable x
Tensor to set to a new value.
object value
Value to set the tensor to, as a Numpy array (of the same shape).

void set_value(_ArrayLike x, object value)

Sets the value of a variable, from a Numpy array.
Parameters
_ArrayLike x
Tensor to set to a new value.
object value
Value to set the tensor to, as a Numpy array (of the same shape).

void set_value(ndarray x, PythonFunctionContainer value)

Sets the value of a variable, from a Numpy array.
Parameters
ndarray x
Tensor to set to a new value.
PythonFunctionContainer value
Value to set the tensor to, as a Numpy array (of the same shape).

object set_value_dyn(object x, object value)

Sets the value of a variable, from a Numpy array.
Parameters
object x
Tensor to set to a new value.
object value
Value to set the tensor to, as a Numpy array (of the same shape).

Tensor shape(IGraphNodeBase x)

Returns the symbolic shape of a tensor or variable.
Parameters
IGraphNodeBase x
A tensor or variable.
Returns
Tensor
A symbolic shape (which is itself a tensor).

Examples:

```python # TensorFlow example >>> from keras import backend as K >>> tf_session = K.get_session() >>> val = np.array([[1, 2], [3, 4]]) >>> kvar = K.variable(value=val) >>> input = keras.backend.placeholder(shape=(2, 4, 5)) >>> K.shape(kvar) >>> K.shape(input) # To get integer shape (Instead, you can use K.int_shape(x)) >>> K.shape(kvar).eval(session=tf_session) array([2, 2], dtype=int32) >>> K.shape(input).eval(session=tf_session) array([2, 4, 5], dtype=int32) ```

Tensor shape(IEnumerable<IGraphNodeBase> x)

Returns the symbolic shape of a tensor or variable.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
Returns
Tensor
A symbolic shape (which is itself a tensor).

Examples:

```python # TensorFlow example >>> from keras import backend as K >>> tf_session = K.get_session() >>> val = np.array([[1, 2], [3, 4]]) >>> kvar = K.variable(value=val) >>> input = keras.backend.placeholder(shape=(2, 4, 5)) >>> K.shape(kvar) >>> K.shape(input) # To get integer shape (Instead, you can use K.int_shape(x)) >>> K.shape(kvar).eval(session=tf_session) array([2, 2], dtype=int32) >>> K.shape(input).eval(session=tf_session) array([2, 4, 5], dtype=int32) ```

object shape_dyn(object x)

Returns the symbolic shape of a tensor or variable.
Parameters
object x
A tensor or variable.
Returns
object
A symbolic shape (which is itself a tensor).

Examples:

```python # TensorFlow example >>> from keras import backend as K >>> tf_session = K.get_session() >>> val = np.array([[1, 2], [3, 4]]) >>> kvar = K.variable(value=val) >>> input = keras.backend.placeholder(shape=(2, 4, 5)) >>> K.shape(kvar) >>> K.shape(input) # To get integer shape (Instead, you can use K.int_shape(x)) >>> K.shape(kvar).eval(session=tf_session) array([2, 2], dtype=int32) >>> K.shape(input).eval(session=tf_session) array([2, 4, 5], dtype=int32) ```

object sigmoid(IGraphNodeBase x)

Element-wise sigmoid.
Parameters
IGraphNodeBase x
A tensor or variable.
Returns
object
A tensor.

object sign(object x)

Element-wise sign.
Parameters
object x
Tensor or variable.
Returns
object
A tensor.

object sign_dyn(object x)

Element-wise sign.
Parameters
object x
Tensor or variable.
Returns
object
A tensor.

object sin(object x)

Computes sin of x element-wise.
Parameters
object x
Tensor or variable.
Returns
object
A tensor.

object sin_dyn(object x)

Computes sin of x element-wise.
Parameters
object x
Tensor or variable.
Returns
object
A tensor.

Tensor softmax(IEnumerable<IGraphNodeBase> x, int axis)

Softmax of a tensor.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
int axis
The dimension softmax would be performed on. The default is -1 which indicates the last dimension.
Returns
Tensor
A tensor.

Tensor softplus(object x)

Softplus of a tensor.
Parameters
object x
A tensor or variable.
Returns
Tensor
A tensor.

Tensor softsign(object x)

Softsign of a tensor.
Parameters
object x
A tensor or variable.
Returns
Tensor
A tensor.

Tensor sparse_categorical_crossentropy(IGraphNodeBase target, IGraphNodeBase output, bool from_logits, int axis)

Categorical crossentropy with integer targets.
Parameters
IGraphNodeBase target
An integer tensor.
IGraphNodeBase output
A tensor resulting from a softmax (unless `from_logits` is True, in which case `output` is expected to be the logits).
bool from_logits
Boolean, whether `output` is the result of a softmax, or is a tensor of logits.
int axis
Int specifying the channels axis. `axis=-1` corresponds to data format `channels_last', and `axis=1` corresponds to data format `channels_first`.
Returns
Tensor
Output tensor.

object sparse_categorical_crossentropy_dyn(object target, object output, ImplicitContainer<T> from_logits, ImplicitContainer<T> axis)

Categorical crossentropy with integer targets.
Parameters
object target
An integer tensor.
object output
A tensor resulting from a softmax (unless `from_logits` is True, in which case `output` is expected to be the logits).
ImplicitContainer<T> from_logits
Boolean, whether `output` is the result of a softmax, or is a tensor of logits.
ImplicitContainer<T> axis
Int specifying the channels axis. `axis=-1` corresponds to data format `channels_last', and `axis=1` corresponds to data format `channels_first`.
Returns
object
Output tensor.

Tensor spatial_2d_padding(IEnumerable<IGraphNodeBase> x, int padding, string data_format)

Pads the 2nd and 3rd dimensions of a 4D tensor.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
int padding
Tuple of 2 tuples, padding pattern.
string data_format
One of `channels_last` or `channels_first`.
Returns
Tensor
A padded 4D tensor.

Tensor spatial_2d_padding(IEnumerable<IGraphNodeBase> x, ValueTuple<object, object> padding, string data_format)

Pads the 2nd and 3rd dimensions of a 4D tensor.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
ValueTuple<object, object> padding
Tuple of 2 tuples, padding pattern.
string data_format
One of `channels_last` or `channels_first`.
Returns
Tensor
A padded 4D tensor.

Tensor spatial_2d_padding(IGraphNodeBase x, int padding, string data_format)

Pads the 2nd and 3rd dimensions of a 4D tensor.
Parameters
IGraphNodeBase x
Tensor or variable.
int padding
Tuple of 2 tuples, padding pattern.
string data_format
One of `channels_last` or `channels_first`.
Returns
Tensor
A padded 4D tensor.

Tensor spatial_2d_padding(IGraphNodeBase x, ValueTuple<object, object> padding, string data_format)

Pads the 2nd and 3rd dimensions of a 4D tensor.
Parameters
IGraphNodeBase x
Tensor or variable.
ValueTuple<object, object> padding
Tuple of 2 tuples, padding pattern.
string data_format
One of `channels_last` or `channels_first`.
Returns
Tensor
A padded 4D tensor.

object spatial_2d_padding_dyn(object x, ImplicitContainer<T> padding, object data_format)

Pads the 2nd and 3rd dimensions of a 4D tensor.
Parameters
object x
Tensor or variable.
ImplicitContainer<T> padding
Tuple of 2 tuples, padding pattern.
object data_format
One of `channels_last` or `channels_first`.
Returns
object
A padded 4D tensor.

Tensor spatial_3d_padding(IGraphNodeBase x, int padding, string data_format)

Pads 5D tensor with zeros along the depth, height, width dimensions.

Pads these dimensions with respectively "padding[0]", "padding[1]" and "padding[2]" zeros left and right.

For 'channels_last' data_format, the 2nd, 3rd and 4th dimension will be padded. For 'channels_first' data_format, the 3rd, 4th and 5th dimension will be padded.
Parameters
IGraphNodeBase x
Tensor or variable.
int padding
Tuple of 3 tuples, padding pattern.
string data_format
One of `channels_last` or `channels_first`.
Returns
Tensor
A padded 5D tensor.

Tensor spatial_3d_padding(IGraphNodeBase x, ValueTuple<object, object, object> padding, string data_format)

Pads 5D tensor with zeros along the depth, height, width dimensions.

Pads these dimensions with respectively "padding[0]", "padding[1]" and "padding[2]" zeros left and right.

For 'channels_last' data_format, the 2nd, 3rd and 4th dimension will be padded. For 'channels_first' data_format, the 3rd, 4th and 5th dimension will be padded.
Parameters
IGraphNodeBase x
Tensor or variable.
ValueTuple<object, object, object> padding
Tuple of 3 tuples, padding pattern.
string data_format
One of `channels_last` or `channels_first`.
Returns
Tensor
A padded 5D tensor.

Tensor spatial_3d_padding(IEnumerable<IGraphNodeBase> x, int padding, string data_format)

Pads 5D tensor with zeros along the depth, height, width dimensions.

Pads these dimensions with respectively "padding[0]", "padding[1]" and "padding[2]" zeros left and right.

For 'channels_last' data_format, the 2nd, 3rd and 4th dimension will be padded. For 'channels_first' data_format, the 3rd, 4th and 5th dimension will be padded.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
int padding
Tuple of 3 tuples, padding pattern.
string data_format
One of `channels_last` or `channels_first`.
Returns
Tensor
A padded 5D tensor.

Tensor spatial_3d_padding(IEnumerable<IGraphNodeBase> x, ValueTuple<object, object, object> padding, string data_format)

Pads 5D tensor with zeros along the depth, height, width dimensions.

Pads these dimensions with respectively "padding[0]", "padding[1]" and "padding[2]" zeros left and right.

For 'channels_last' data_format, the 2nd, 3rd and 4th dimension will be padded. For 'channels_first' data_format, the 3rd, 4th and 5th dimension will be padded.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
ValueTuple<object, object, object> padding
Tuple of 3 tuples, padding pattern.
string data_format
One of `channels_last` or `channels_first`.
Returns
Tensor
A padded 5D tensor.

object spatial_3d_padding_dyn(object x, ImplicitContainer<T> padding, object data_format)

Pads 5D tensor with zeros along the depth, height, width dimensions.

Pads these dimensions with respectively "padding[0]", "padding[1]" and "padding[2]" zeros left and right.

For 'channels_last' data_format, the 2nd, 3rd and 4th dimension will be padded. For 'channels_first' data_format, the 3rd, 4th and 5th dimension will be padded.
Parameters
object x
Tensor or variable.
ImplicitContainer<T> padding
Tuple of 3 tuples, padding pattern.
object data_format
One of `channels_last` or `channels_first`.
Returns
object
A padded 5D tensor.

object sqrt(IGraphNodeBase x)

Element-wise square root.
Parameters
IGraphNodeBase x
Tensor or variable.
Returns
object
A tensor.

object sqrt(_ArrayLike x)

Element-wise square root.
Parameters
_ArrayLike x
Tensor or variable.
Returns
object
A tensor.

object sqrt_dyn(object x)

Element-wise square root.
Parameters
object x
Tensor or variable.
Returns
object
A tensor.

object square(object x)

Element-wise square.
Parameters
object x
Tensor or variable.
Returns
object
A tensor.

object square_dyn(object x)

Element-wise square.
Parameters
object x
Tensor or variable.
Returns
object
A tensor.

Tensor squeeze(object x, object axis)

Removes a 1-dimension from the tensor at index "axis".
Parameters
object x
A tensor or variable.
object axis
Axis to drop.
Returns
Tensor
A tensor with the same data as `x` but reduced dimensions.

object squeeze_dyn(object x, object axis)

Removes a 1-dimension from the tensor at index "axis".
Parameters
object x
A tensor or variable.
object axis
Axis to drop.
Returns
object
A tensor with the same data as `x` but reduced dimensions.

Tensor stack(IEnumerable<object> x, int axis)

Join a sequence of arrays along a new axis.

object stack_dyn(object x, ImplicitContainer<T> axis)

Stacks a list of rank `R` tensors into a rank `R+1` tensor.
Parameters
object x
List of tensors.
ImplicitContainer<T> axis
Axis along which to perform stacking.
Returns
object
A tensor.

Example: ```python >>> a = tf.constant([[1, 2],[3, 4]]) >>> b = tf.constant([[10, 20],[30, 40]]) >>> tf.keras.backend.stack((a, b)) ```

object std(object x, object axis, bool keepdims)

Standard deviation of a tensor, alongside the specified axis.
Parameters
object x
A tensor or variable.
object axis
An integer, the axis to compute the standard deviation.
bool keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
object
A tensor with the standard deviation of elements of `x`.

object std_dyn(object x, object axis, ImplicitContainer<T> keepdims)

Standard deviation of a tensor, alongside the specified axis.
Parameters
object x
A tensor or variable.
object axis
An integer, the axis to compute the standard deviation.
ImplicitContainer<T> keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
object
A tensor with the standard deviation of elements of `x`.

object stop_gradient(IEnumerable<object> variables)

Returns `variables` but with zero gradient w.r.t. every other variable.
Parameters
IEnumerable<object> variables
Tensor or list of tensors to consider constant with respect to any other variable.
Returns
object
A single tensor or a list of tensors (depending on the passed argument) that has no gradient with respect to any other variable.

object stop_gradient(IGraphNodeBase variables)

Returns `variables` but with zero gradient w.r.t. every other variable.
Parameters
IGraphNodeBase variables
Tensor or list of tensors to consider constant with respect to any other variable.
Returns
object
A single tensor or a list of tensors (depending on the passed argument) that has no gradient with respect to any other variable.

object stop_gradient(ValueTuple<IEnumerable<object>, object> variables)

Returns `variables` but with zero gradient w.r.t. every other variable.
Parameters
ValueTuple<IEnumerable<object>, object> variables
Tensor or list of tensors to consider constant with respect to any other variable.
Returns
object
A single tensor or a list of tensors (depending on the passed argument) that has no gradient with respect to any other variable.

object stop_gradient_dyn(object variables)

Returns `variables` but with zero gradient w.r.t. every other variable.
Parameters
object variables
Tensor or list of tensors to consider constant with respect to any other variable.
Returns
object
A single tensor or a list of tensors (depending on the passed argument) that has no gradient with respect to any other variable.

Tensor sum(IGraphNodeBase x, Nullable<int> axis, bool keepdims)

Sum of the values in a tensor, alongside the specified axis.
Parameters
IGraphNodeBase x
A tensor or variable.
Nullable<int> axis
An integer, the axis to sum over.
bool keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
Tensor
A tensor with sum of `x`.

Tensor sum(IEnumerable<IGraphNodeBase> x, Nullable<int> axis, bool keepdims)

Sum of the values in a tensor, alongside the specified axis.
Parameters
IEnumerable<IGraphNodeBase> x
A tensor or variable.
Nullable<int> axis
An integer, the axis to sum over.
bool keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
Tensor
A tensor with sum of `x`.

object sum_dyn(object x, object axis, ImplicitContainer<T> keepdims)

Sum of the values in a tensor, alongside the specified axis.
Parameters
object x
A tensor or variable.
object axis
An integer, the axis to sum over.
ImplicitContainer<T> keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
object
A tensor with sum of `x`.

object switch(bool condition, IEnumerable<object> then_expression, object else_expression)

object switch(bool condition, PythonFunctionContainer then_expression, object else_expression)

object switch(bool condition, object then_expression, object else_expression)

object switch(IEnumerable<PythonClassContainer> condition, IEnumerable<object> then_expression, object else_expression)

object switch(IEnumerable<PythonClassContainer> condition, ValueTuple<IEnumerable<object>, object> then_expression, object else_expression)

object switch(IEnumerable<PythonClassContainer> condition, IGraphNodeBase then_expression, object else_expression)

object switch(IEnumerable<PythonClassContainer> condition, PythonFunctionContainer then_expression, object else_expression)

object switch(IEnumerable<PythonClassContainer> condition, object then_expression, object else_expression)

object switch(IndexedSlices condition, IEnumerable<object> then_expression, object else_expression)

object switch(IndexedSlices condition, ValueTuple<IEnumerable<object>, object> then_expression, object else_expression)

object switch(IndexedSlices condition, IGraphNodeBase then_expression, object else_expression)

object switch(IndexedSlices condition, PythonFunctionContainer then_expression, object else_expression)

object switch(IGraphNodeBase condition, ValueTuple<IEnumerable<object>, object> then_expression, object else_expression)

object switch(IGraphNodeBase condition, IGraphNodeBase then_expression, object else_expression)

object switch(IGraphNodeBase condition, PythonFunctionContainer then_expression, object else_expression)

object switch(IGraphNodeBase condition, object then_expression, object else_expression)

object switch(PythonClassContainer condition, IEnumerable<object> then_expression, object else_expression)

object switch(PythonClassContainer condition, ValueTuple<IEnumerable<object>, object> then_expression, object else_expression)

object switch(bool condition, IGraphNodeBase then_expression, object else_expression)

object switch(PythonClassContainer condition, IGraphNodeBase then_expression, object else_expression)

object switch(PythonClassContainer condition, object then_expression, object else_expression)

object switch(int condition, PythonFunctionContainer then_expression, object else_expression)

object switch(int condition, IGraphNodeBase then_expression, object else_expression)

object switch(int condition, ValueTuple<IEnumerable<object>, object> then_expression, object else_expression)

object switch(int condition, IEnumerable<object> then_expression, object else_expression)

object switch(IndexedSlices condition, object then_expression, object else_expression)

object switch(PythonClassContainer condition, PythonFunctionContainer then_expression, object else_expression)

object switch(bool condition, ValueTuple<IEnumerable<object>, object> then_expression, object else_expression)

object switch(IGraphNodeBase condition, IEnumerable<object> then_expression, object else_expression)

object switch(int condition, object then_expression, object else_expression)

object tanh(object x)

Element-wise tanh.
Parameters
object x
A tensor or variable.
Returns
object
A tensor.

object tanh_dyn(object x)

Element-wise tanh.
Parameters
object x
A tensor or variable.
Returns
object
A tensor.

Tensor temporal_padding(IGraphNodeBase x, ValueTuple<int, object> padding)

Pads the middle dimension of a 3D tensor.
Parameters
IGraphNodeBase x
Tensor or variable.
ValueTuple<int, object> padding
Tuple of 2 integers, how many zeros to add at the start and end of dim 1.
Returns
Tensor
A padded 3D tensor.

Tensor temporal_padding(IGraphNodeBase x, ImplicitContainer<T> padding)

Pads the middle dimension of a 3D tensor.
Parameters
IGraphNodeBase x
Tensor or variable.
ImplicitContainer<T> padding
Tuple of 2 integers, how many zeros to add at the start and end of dim 1.
Returns
Tensor
A padded 3D tensor.

Tensor temporal_padding(IEnumerable<IGraphNodeBase> x, ValueTuple<int, object> padding)

Pads the middle dimension of a 3D tensor.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
ValueTuple<int, object> padding
Tuple of 2 integers, how many zeros to add at the start and end of dim 1.
Returns
Tensor
A padded 3D tensor.

Tensor temporal_padding(IEnumerable<IGraphNodeBase> x, ImplicitContainer<T> padding)

Pads the middle dimension of a 3D tensor.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
ImplicitContainer<T> padding
Tuple of 2 integers, how many zeros to add at the start and end of dim 1.
Returns
Tensor
A padded 3D tensor.

Tensor temporal_padding(IEnumerable<IGraphNodeBase> x, int padding)

Pads the middle dimension of a 3D tensor.
Parameters
IEnumerable<IGraphNodeBase> x
Tensor or variable.
int padding
Tuple of 2 integers, how many zeros to add at the start and end of dim 1.
Returns
Tensor
A padded 3D tensor.

Tensor temporal_padding(IGraphNodeBase x, int padding)

Pads the middle dimension of a 3D tensor.
Parameters
IGraphNodeBase x
Tensor or variable.
int padding
Tuple of 2 integers, how many zeros to add at the start and end of dim 1.
Returns
Tensor
A padded 3D tensor.

object temporal_padding_dyn(object x, ImplicitContainer<T> padding)

Pads the middle dimension of a 3D tensor.
Parameters
object x
Tensor or variable.
ImplicitContainer<T> padding
Tuple of 2 integers, how many zeros to add at the start and end of dim 1.
Returns
object
A padded 3D tensor.

Tensor tile(IGraphNodeBase x, int n)

Creates a tensor by tiling `x` by `n`.
Parameters
IGraphNodeBase x
A tensor or variable
int n
A list of integer. The length must be the same as the number of dimensions in `x`.
Returns
Tensor
A tiled tensor.

Tensor tile(IGraphNodeBase x, IGraphNodeBase n)

Creates a tensor by tiling `x` by `n`.
Parameters
IGraphNodeBase x
A tensor or variable
IGraphNodeBase n
A list of integer. The length must be the same as the number of dimensions in `x`.
Returns
Tensor
A tiled tensor.

Tensor tile(IGraphNodeBase x, IEnumerable<int> n)

Creates a tensor by tiling `x` by `n`.
Parameters
IGraphNodeBase x
A tensor or variable
IEnumerable<int> n
A list of integer. The length must be the same as the number of dimensions in `x`.
Returns
Tensor
A tiled tensor.

object tile_dyn(object x, object n)

Construct an array by repeating A the number of times given by reps.

object to_dense(IEnumerable<IGraphNodeBase> tensor)

Converts a sparse tensor into a dense tensor and returns it.
Parameters
IEnumerable<IGraphNodeBase> tensor
A tensor instance (potentially sparse).
Returns
object
A dense tensor.

Examples: ```python >>> from keras import backend as K >>> b = K.placeholder((2, 2), sparse=True) >>> print(K.is_sparse(b)) True >>> c = K.to_dense(b) >>> print(K.is_sparse(c)) False ```

object to_dense(IGraphNodeBase tensor)

Converts a sparse tensor into a dense tensor and returns it.
Parameters
IGraphNodeBase tensor
A tensor instance (potentially sparse).
Returns
object
A dense tensor.

Examples: ```python >>> from keras import backend as K >>> b = K.placeholder((2, 2), sparse=True) >>> print(K.is_sparse(b)) True >>> c = K.to_dense(b) >>> print(K.is_sparse(c)) False ```

object to_dense(PythonFunctionContainer tensor)

Converts a sparse tensor into a dense tensor and returns it.
Parameters
PythonFunctionContainer tensor
A tensor instance (potentially sparse).
Returns
object
A dense tensor.

Examples: ```python >>> from keras import backend as K >>> b = K.placeholder((2, 2), sparse=True) >>> print(K.is_sparse(b)) True >>> c = K.to_dense(b) >>> print(K.is_sparse(c)) False ```

object to_dense_dyn(object tensor)

Converts a sparse tensor into a dense tensor and returns it.
Parameters
object tensor
A tensor instance (potentially sparse).
Returns
object
A dense tensor.

Examples: ```python >>> from keras import backend as K >>> b = K.placeholder((2, 2), sparse=True) >>> print(K.is_sparse(b)) True >>> c = K.to_dense(b) >>> print(K.is_sparse(c)) False ```

Tensor transpose(IGraphNodeBase x)

Transposes a tensor and returns it.
Parameters
IGraphNodeBase x
Tensor or variable.
Returns
Tensor
A tensor.

Examples: ```python >>> var = K.variable([[1, 2, 3], [4, 5, 6]]) >>> K.eval(var) array([[ 1., 2., 3.], [ 4., 5., 6.]], dtype=float32) >>> var_transposed = K.transpose(var) >>> K.eval(var_transposed) array([[ 1., 4.], [ 2., 5.], [ 3., 6.]], dtype=float32) ```

```python >>> input = K.placeholder((2, 3)) >>> input >>> input_transposed = K.transpose(input) >>> input_transposed

```

object transpose_dyn(object x)

Transposes a tensor and returns it.
Parameters
object x
Tensor or variable.
Returns
object
A tensor.

Examples: ```python >>> var = K.variable([[1, 2, 3], [4, 5, 6]]) >>> K.eval(var) array([[ 1., 2., 3.], [ 4., 5., 6.]], dtype=float32) >>> var_transposed = K.transpose(var) >>> K.eval(var_transposed) array([[ 1., 4.], [ 2., 5.], [ 3., 6.]], dtype=float32) ```

```python >>> input = K.placeholder((2, 3)) >>> input >>> input_transposed = K.transpose(input) >>> input_transposed

```

Tensor truncated_normal(ValueTuple<int, object> shape, double mean, double stddev, DType dtype, object seed)

Returns a tensor with truncated random normal distribution of values.

The generated values follow a normal distribution with specified mean and standard deviation, except that values whose magnitude is more than two standard deviations from the mean are dropped and re-picked.
Parameters
ValueTuple<int, object> shape
A tuple of integers, the shape of tensor to create.
double mean
Mean of the values.
double stddev
Standard deviation of the values.
DType dtype
String, dtype of returned tensor.
object seed
Integer, random seed.
Returns
Tensor
A tensor.

object truncated_normal_dyn(object shape, ImplicitContainer<T> mean, ImplicitContainer<T> stddev, object dtype, object seed)

Returns a tensor with truncated random normal distribution of values.

The generated values follow a normal distribution with specified mean and standard deviation, except that values whose magnitude is more than two standard deviations from the mean are dropped and re-picked.
Parameters
object shape
A tuple of integers, the shape of tensor to create.
ImplicitContainer<T> mean
Mean of the values.
ImplicitContainer<T> stddev
Standard deviation of the values.
object dtype
String, dtype of returned tensor.
object seed
Integer, random seed.
Returns
object
A tensor.

Tensor update(IGraphNodeBase x, double new_x)

object update_add(object x, object increment)

Update the value of `x` by adding `increment`.
Parameters
object x
A Variable.
object increment
A tensor of same shape as `x`.
Returns
object
The variable `x` updated.

object update_add_dyn(object x, object increment)

Update the value of `x` by adding `increment`.
Parameters
object x
A Variable.
object increment
A tensor of same shape as `x`.
Returns
object
The variable `x` updated.

object update_sub(object x, object decrement)

Update the value of `x` by subtracting `decrement`.
Parameters
object x
A Variable.
object decrement
A tensor of same shape as `x`.
Returns
object
The variable `x` updated.

object update_sub_dyn(object x, object decrement)

Update the value of `x` by subtracting `decrement`.
Parameters
object x
A Variable.
object decrement
A tensor of same shape as `x`.
Returns
object
The variable `x` updated.

object var(object x, object axis, bool keepdims)

Variance of a tensor, alongside the specified axis.
Parameters
object x
A tensor or variable.
object axis
An integer, the axis to compute the variance.
bool keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
object
A tensor with the variance of elements of `x`.

object var_dyn(object x, object axis, ImplicitContainer<T> keepdims)

Variance of a tensor, alongside the specified axis.
Parameters
object x
A tensor or variable.
object axis
An integer, the axis to compute the variance.
ImplicitContainer<T> keepdims
A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor is reduced by 1. If `keepdims` is `True`, the reduced dimension is retained with length 1.
Returns
object
A tensor with the variance of elements of `x`.

object variable(object value, DType dtype, string name, object constraint)

Instantiates a variable and returns it.
Parameters
object value
Numpy array, initial value of the tensor.
DType dtype
Tensor type.
string name
Optional name string for the tensor.
object constraint
Optional projection function to be applied to the variable after an optimizer update.
Returns
object
A variable instance (with Keras metadata included).

Examples: ```python >>> import numpy as np >>> from keras import backend as K >>> val = np.array([[1, 2], [3, 4]]) >>> kvar = K.variable(value=val, dtype='float64', name='example_var') >>> K.dtype(kvar) 'float64' >>> print(kvar) example_var >>> kvar.eval() array([[ 1., 2.], [ 3., 4.]]) ```

object variable_dyn(object value, object dtype, object name, object constraint)

Instantiates a variable and returns it.
Parameters
object value
Numpy array, initial value of the tensor.
object dtype
Tensor type.
object name
Optional name string for the tensor.
object constraint
Optional projection function to be applied to the variable after an optimizer update.
Returns
object
A variable instance (with Keras metadata included).

Examples: ```python >>> import numpy as np >>> from keras import backend as K >>> val = np.array([[1, 2], [3, 4]]) >>> kvar = K.variable(value=val, dtype='float64', name='example_var') >>> K.dtype(kvar) 'float64' >>> print(kvar) example_var >>> kvar.eval() array([[ 1., 2.], [ 3., 4.]]) ```

object zeros(int shape, string dtype, string name)

Instantiates an all-zeros variable and returns it.
Parameters
int shape
Tuple or list of integers, shape of returned Keras variable
string dtype
data type of returned Keras variable
string name
name of returned Keras variable
Returns
object
A variable (including Keras metadata), filled with `0.0`. Note that if `shape` was symbolic, we cannot return a variable, and will return a dynamically-shaped tensor instead.

Example:

```python from tensorflow.keras import backend as K kvar = K.zeros((3,4)) K.eval(kvar) # array([[ 0., 0., 0., 0.], [ 0., 0., 0., 0.], # [ 0., 0., 0., 0.]], dtype=float32) A = tf.constant([1,2,3]) kvar2 = K.zeros(A.shape) # [0., 0., 0.] float32 by default kvar3 = K.zeros(A.shape,dtype=tf.int32) # [0, 0, 0] with int32 dtype kvar4 = K.zeros([2,3]) # [[0., 0., 0.], [0., 0., 0.]] ```

object zeros(IEnumerable<int> shape, string dtype, string name)

Instantiates an all-zeros variable and returns it.
Parameters
IEnumerable<int> shape
Tuple or list of integers, shape of returned Keras variable
string dtype
data type of returned Keras variable
string name
name of returned Keras variable
Returns
object
A variable (including Keras metadata), filled with `0.0`. Note that if `shape` was symbolic, we cannot return a variable, and will return a dynamically-shaped tensor instead.

Example:

```python from tensorflow.keras import backend as K kvar = K.zeros((3,4)) K.eval(kvar) # array([[ 0., 0., 0., 0.], [ 0., 0., 0., 0.], # [ 0., 0., 0., 0.]], dtype=float32) A = tf.constant([1,2,3]) kvar2 = K.zeros(A.shape) # [0., 0., 0.] float32 by default kvar3 = K.zeros(A.shape,dtype=tf.int32) # [0, 0, 0] with int32 dtype kvar4 = K.zeros([2,3]) # [[0., 0., 0.], [0., 0., 0.]] ```

object zeros(TensorShape shape, string dtype, string name)

Instantiates an all-zeros variable and returns it.
Parameters
TensorShape shape
Tuple or list of integers, shape of returned Keras variable
string dtype
data type of returned Keras variable
string name
name of returned Keras variable
Returns
object
A variable (including Keras metadata), filled with `0.0`. Note that if `shape` was symbolic, we cannot return a variable, and will return a dynamically-shaped tensor instead.

Example:

```python from tensorflow.keras import backend as K kvar = K.zeros((3,4)) K.eval(kvar) # array([[ 0., 0., 0., 0.], [ 0., 0., 0., 0.], # [ 0., 0., 0., 0.]], dtype=float32) A = tf.constant([1,2,3]) kvar2 = K.zeros(A.shape) # [0., 0., 0.] float32 by default kvar3 = K.zeros(A.shape,dtype=tf.int32) # [0, 0, 0] with int32 dtype kvar4 = K.zeros([2,3]) # [[0., 0., 0.], [0., 0., 0.]] ```

object zeros_dyn(object shape, object dtype, object name)

Instantiates an all-zeros variable and returns it.
Parameters
object shape
Tuple or list of integers, shape of returned Keras variable
object dtype
data type of returned Keras variable
object name
name of returned Keras variable
Returns
object
A variable (including Keras metadata), filled with `0.0`. Note that if `shape` was symbolic, we cannot return a variable, and will return a dynamically-shaped tensor instead.

Example:

```python from tensorflow.keras import backend as K kvar = K.zeros((3,4)) K.eval(kvar) # array([[ 0., 0., 0., 0.], [ 0., 0., 0., 0.], # [ 0., 0., 0., 0.]], dtype=float32) A = tf.constant([1,2,3]) kvar2 = K.zeros(A.shape) # [0., 0., 0.] float32 by default kvar3 = K.zeros(A.shape,dtype=tf.int32) # [0, 0, 0] with int32 dtype kvar4 = K.zeros([2,3]) # [[0., 0., 0.], [0., 0., 0.]] ```

Tensor zeros_like(IndexedSlices x, DType dtype, string name)

Instantiates an all-zeros variable of the same shape as another tensor.
Parameters
IndexedSlices x
Keras variable or Keras tensor.
DType dtype
dtype of returned Keras variable. `None` uses the dtype of `x`.
string name
name for the variable to create.
Returns
Tensor
A Keras variable with the shape of `x` filled with zeros.

Example:

```python from tensorflow.keras import backend as K kvar = K.variable(np.random.random((2,3))) kvar_zeros = K.zeros_like(kvar) K.eval(kvar_zeros) # array([[ 0., 0., 0.], [ 0., 0., 0.]], dtype=float32) ```

Tensor zeros_like(IEnumerable<object> x, DType dtype, string name)

Instantiates an all-zeros variable of the same shape as another tensor.
Parameters
IEnumerable<object> x
Keras variable or Keras tensor.
DType dtype
dtype of returned Keras variable. `None` uses the dtype of `x`.
string name
name for the variable to create.
Returns
Tensor
A Keras variable with the shape of `x` filled with zeros.

Example:

```python from tensorflow.keras import backend as K kvar = K.variable(np.random.random((2,3))) kvar_zeros = K.zeros_like(kvar) K.eval(kvar_zeros) # array([[ 0., 0., 0.], [ 0., 0., 0.]], dtype=float32) ```

Public properties

PythonFunctionContainer arange_fn get;

PythonFunctionContainer argmax_fn get;

PythonFunctionContainer argmin_fn get;

PythonFunctionContainer backend__fn get;

PythonFunctionContainer batch_dot_fn get;

PythonFunctionContainer batch_flatten_fn get;

PythonFunctionContainer batch_get_value_fn get;

PythonFunctionContainer batch_normalization_fn get;

PythonFunctionContainer batch_set_value_fn get;

PythonFunctionContainer bias_add_fn get;

PythonFunctionContainer binary_crossentropy_fn get;

PythonFunctionContainer cast_to_floatx_fn get;

PythonFunctionContainer categorical_crossentropy_fn get;

PythonFunctionContainer clear_session_fn get;

PythonFunctionContainer concatenate_fn get;

PythonFunctionContainer constant_fn get;

PythonFunctionContainer conv1d_fn get;

PythonFunctionContainer conv2d_fn get;

PythonFunctionContainer conv2d_transpose_fn get;

PythonFunctionContainer conv3d_fn get;

PythonFunctionContainer count_params_fn get;

PythonFunctionContainer ctc_batch_cost_fn get;

PythonFunctionContainer ctc_decode_fn get;

PythonFunctionContainer ctc_label_dense_to_sparse_fn get;

PythonFunctionContainer cumprod_fn get;

PythonFunctionContainer cumsum_fn get;

PythonFunctionContainer dropout_fn get;

PythonFunctionContainer dtype_fn get;

PythonFunctionContainer epsilon_fn get;

PythonFunctionContainer equal_fn get;

PythonFunctionContainer expand_dims_fn get;

PythonFunctionContainer flatten_fn get;

PythonFunctionContainer floatx_fn get;

PythonFunctionContainer foldl_fn get;

PythonFunctionContainer foldr_fn get;

PythonFunctionContainer function_fn get;

PythonFunctionContainer gather_fn get;

PythonFunctionContainer get_session_fn get;

PythonFunctionContainer get_uid_fn get;

PythonFunctionContainer get_value_fn get;

PythonFunctionContainer gradients_fn get;

PythonFunctionContainer greater_equal_fn get;

PythonFunctionContainer greater_fn get;

PythonFunctionContainer hard_sigmoid_fn get;

PythonFunctionContainer image_data_format_fn get;

PythonFunctionContainer in_test_phase_fn get;

PythonFunctionContainer in_top_k_fn get;

PythonFunctionContainer in_train_phase_fn get;

PythonFunctionContainer int_shape_fn get;

PythonFunctionContainer is_sparse_fn get;

PythonFunctionContainer l2_normalize_fn get;

PythonFunctionContainer learning_phase_fn get;

PythonFunctionContainer learning_phase_scope_fn get;

PythonFunctionContainer less_equal_fn get;

PythonFunctionContainer local_conv1d_fn get;

PythonFunctionContainer local_conv2d_fn get;

PythonFunctionContainer manual_variable_initialization_fn get;

PythonFunctionContainer map_fn_fn get;

PythonFunctionContainer maximum_fn get;

PythonFunctionContainer minimum_fn get;

PythonFunctionContainer moving_average_update_fn get;

PythonFunctionContainer name_scope_fn get;

PythonFunctionContainer normalize_batch_in_training_fn get;

PythonFunctionContainer not_equal_fn get;

PythonFunctionContainer one_hot_fn get;

PythonFunctionContainer ones_like_fn get;

PythonFunctionContainer permute_dimensions_fn get;

PythonFunctionContainer placeholder_fn get;

PythonFunctionContainer pool2d_fn get;

PythonFunctionContainer pool3d_fn get;

PythonFunctionContainer random_binomial_fn get;

PythonFunctionContainer random_normal_fn get;

PythonFunctionContainer random_normal_variable_fn get;

PythonFunctionContainer random_uniform_fn get;

PythonFunctionContainer random_uniform_variable_fn get;

PythonFunctionContainer repeat_elements_fn get;

PythonFunctionContainer repeat_fn get;

PythonFunctionContainer reset_uids_fn get;

PythonFunctionContainer reshape_fn get;

PythonFunctionContainer resize_images_fn get;

PythonFunctionContainer resize_volumes_fn get;

PythonFunctionContainer reverse_fn get;

PythonFunctionContainer round_fn get;

PythonFunctionContainer separable_conv2d_fn get;

PythonFunctionContainer set_epsilon__fn get;

PythonFunctionContainer set_floatx__fn get;

PythonFunctionContainer set_image_data_format__fn get;

PythonFunctionContainer set_learning_phase__fn get;

PythonFunctionContainer set_session_fn get;

PythonFunctionContainer set_value_fn get;

PythonFunctionContainer shape_fn get;

PythonFunctionContainer sigmoid_fn get;

PythonFunctionContainer softmax_fn get;

PythonFunctionContainer softplus_fn get;

PythonFunctionContainer softsign_fn get;

PythonFunctionContainer sparse_categorical_crossentropy_fn get;

PythonFunctionContainer spatial_2d_padding_fn get;

PythonFunctionContainer spatial_3d_padding_fn get;

PythonFunctionContainer square_fn get;

PythonFunctionContainer squeeze_fn get;

PythonFunctionContainer stack_fn get;

PythonFunctionContainer stop_gradient_fn get;

PythonFunctionContainer switch_fn get;

PythonFunctionContainer temporal_padding_fn get;

PythonFunctionContainer to_dense_fn get;

PythonFunctionContainer transpose_fn get;

PythonFunctionContainer truncated_normal_fn get;

PythonFunctionContainer update_add_fn get;

PythonFunctionContainer update_fn get;

PythonFunctionContainer update_sub_fn get;

PythonFunctionContainer variable_fn get;

PythonFunctionContainer zeros_fn get;

PythonFunctionContainer zeros_like_fn get;