LostTech.TensorFlow : API Documentation

Type ops

Namespace tensorflow.contrib.labeled_tensor._ops

Public static methods

List batch(IEnumerable<LabeledTensor> labeled_tensors, int batch_size, int num_threads, int capacity, bool enqueue_many, bool allow_smaller_final_batch, string name)

object batch_dyn(object labeled_tensors, object batch_size, ImplicitContainer<T> num_threads, ImplicitContainer<T> capacity, ImplicitContainer<T> enqueue_many, ImplicitContainer<T> allow_smaller_final_batch, object name)

PythonClassContainer boolean_mask(PythonClassContainer labeled_tensor, PythonClassContainer mask, string name)

object boolean_mask_dyn(object labeled_tensor, object mask, object name)

Applies a boolean mask to `data` without flattening the mask dimensions.

Returns a potentially ragged tensor that is formed by retaining the elements in `data` where the corresponding value in `mask` is `True`.

* `output[a1...aA, i, b1...bB] = data[a1...aA, j, b1...bB]`

Where `j` is the `i`th `True` entry of `mask[a1...aA]`.

Note that `output` preserves the mask dimensions `a1...aA`; this differs from tf.boolean_mask, which flattens those dimensions.
Parameters
object labeled_tensor
object mask
A potentially ragged boolean tensor. `mask`'s shape must be a prefix of `data`'s shape. `rank(mask)` must be known statically.
object name
A name prefix for the returned tensor (optional).
Returns
object
A potentially ragged tensor that is formed by retaining the elements in `data` where the corresponding value in `mask` is `True`.

* `rank(output) = rank(data)`. * `output.ragged_rank = max(data.ragged_rank, rank(mask) - 1)`.

PythonClassContainer concat(IEnumerable<PythonClassContainer> labeled_tensors, string axis_name, string name)

object concat_dyn(object labeled_tensors, object axis_name, object name)

PythonClassContainer constant(int value, DType dtype, Axes axes, string name)

PythonClassContainer constant(IEnumerable<string> value, DType dtype, IEnumerable<string> axes, string name)

PythonClassContainer constant(IEnumerable<string> value, DType dtype, Axes axes, string name)

PythonClassContainer constant(int value, DType dtype, IEnumerable<string> axes, string name)

object constant_dyn(object value, object dtype, object axes, object name)

Creates a constant tensor.
Parameters
object value
A constant value (or list)
object dtype
The type of the elements of the resulting tensor.
object axes
object name
Optional name for the tensor.
Returns
object
A Constant Tensor.

object define_reduce_op(string op_name, PythonFunctionContainer reduce_fn)

object define_reduce_op_dyn(object op_name, object reduce_fn)

PythonClassContainer foldl(object fn, PythonClassContainer labeled_tensor, PythonClassContainer initial_value, string name)

object foldl_dyn(object fn, object labeled_tensor, object initial_value, object 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 labeled_tensor
object initial_value
object name
A string name for the foldl node in the graph
Returns
object
Tensor with same type and shape as `initializer`.

PythonClassContainer map_fn(PythonFunctionContainer fn, PythonClassContainer labeled_tensor, string name)

object map_fn_dyn(object fn, object labeled_tensor, object name)

object matmul_dyn(object a, object b, object name)

PythonClassContainer ones_like(PythonClassContainer labeled_tensor, DType dtype, string name)

PythonClassContainer pack(IEnumerable<object> labeled_tensors, string new_axis, int axis_position, string name)

object pack_dyn(object labeled_tensors, object new_axis, ImplicitContainer<T> axis_position, object name)

PythonClassContainer pad(PythonClassContainer labeled_tensor, IDictionary<string, ValueTuple<int, object>> paddings, string mode, string name)

object pad_dyn(object labeled_tensor, object paddings, ImplicitContainer<T> mode, object name)

PythonClassContainer random_crop(PythonClassContainer labeled_tensor, IDictionary<string, int> shape_map, Nullable<int> seed, string name)

PythonClassContainer rename_axis(PythonClassContainer labeled_tensor, string existing_name, string new_name, string name)

object rename_axis_dyn(object labeled_tensor, object existing_name, object new_name, object name)

PythonClassContainer reshape(PythonClassContainer labeled_tensor, IEnumerable<object> existing_axes, IEnumerable<Axis> new_axes, string name)

object reshape_dyn(object labeled_tensor, object existing_axes, object new_axes, object name)

PythonClassContainer select(PythonClassContainer labeled_tensor, IDictionary<string, string> selection, string name)

object select_dyn(object labeled_tensor, object selection, object name)

List shuffle_batch(IEnumerable<LabeledTensor> labeled_tensors, int batch_size, int num_threads, int capacity, bool enqueue_many, int min_after_dequeue, Nullable<int> seed, bool allow_smaller_final_batch, string name)

object shuffle_batch_dyn(object labeled_tensors, object batch_size, ImplicitContainer<T> num_threads, ImplicitContainer<T> capacity, ImplicitContainer<T> enqueue_many, ImplicitContainer<T> min_after_dequeue, object seed, ImplicitContainer<T> allow_smaller_final_batch, object name)

PythonClassContainer squeeze(PythonClassContainer labeled_tensor, IEnumerable<object> axis_names, string name)

PythonClassContainer tile(PythonClassContainer labeled_tensor, IDictionary<string, int> multiples, string name)

List unpack(LabeledTensor labeled_tensor, string axis_name, string name)

object unpack_dyn(object labeled_tensor, object axis_name, object name)

PythonClassContainer verify_tensor_all_finite(PythonClassContainer labeled_tensor, string message, string name)

object verify_tensor_all_finite_dyn(object labeled_tensor, object message, object name)

PythonClassContainer zeros_like(PythonClassContainer labeled_tensor, DType dtype, string name)

Instantiates an all-zeros variable of the same shape as another tensor.
Parameters
PythonClassContainer labeled_tensor
DType dtype
dtype of returned Keras variable. `None` uses the dtype of `x`.
string name
name for the variable to create.
Returns
PythonClassContainer
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 batch_fn get;

PythonFunctionContainer boolean_mask_fn get;

PythonFunctionContainer concat_fn get;

PythonFunctionContainer constant_fn get;

PythonFunctionContainer define_reduce_op_fn get;

PythonFunctionContainer foldl_fn get;

PythonFunctionContainer map_fn_fn get;

PythonFunctionContainer matmul_fn get;

PythonFunctionContainer ones_like_fn get;

PythonFunctionContainer random_crop_fn get;

object reduce_all get; set;

object reduce_all_dyn get; set;

object reduce_any get; set;

object reduce_any_dyn get; set;

object reduce_logsumexp get; set;

object reduce_logsumexp_dyn get; set;

object reduce_max get; set;

object reduce_max_dyn get; set;

object reduce_mean get; set;

object reduce_mean_dyn get; set;

object reduce_min get; set;

object reduce_min_dyn get; set;

object reduce_prod get; set;

object reduce_prod_dyn get; set;

object reduce_sum get; set;

object reduce_sum_dyn get; set;

Optional ReduceAxes get; set;

object ReduceAxes_dyn get; set;

Union ReduceAxis get; set;

object ReduceAxis_dyn get; set;

PythonFunctionContainer rename_axis_fn get;

PythonFunctionContainer reshape_fn get;

PythonFunctionContainer select_fn get;

PythonFunctionContainer shuffle_batch_fn get;

PythonFunctionContainer squeeze_fn get;

PythonFunctionContainer unpack_fn get;

PythonFunctionContainer verify_tensor_all_finite_fn get;

PythonFunctionContainer where_fn get;

PythonFunctionContainer zeros_like_fn get;