Type ops
Namespace tensorflow.contrib.labeled_tensor._ops
Methods
- batch
- batch_dyn
- boolean_mask
- boolean_mask_dyn
- concat
- concat_dyn
- constant
- constant
- constant
- constant
- constant_dyn
- define_reduce_op
- define_reduce_op_dyn
- foldl
- foldl_dyn
- map_fn
- map_fn_dyn
- matmul
- matmul_dyn
- ones_like
- pack
- pack_dyn
- pad
- pad_dyn
- random_crop
- rename_axis
- rename_axis_dyn
- reshape
- reshape_dyn
- select
- select_dyn
- shuffle_batch
- shuffle_batch_dyn
- squeeze
- tile
- unpack
- unpack_dyn
- verify_tensor_all_finite
- verify_tensor_all_finite_dyn
- where
- zeros_like
Properties
- batch_fn
- boolean_mask_fn
- cast_fn
- concat_fn
- constant_fn
- define_reduce_op_fn
- foldl_fn
- map_fn_fn
- matmul_fn
- ones_like_fn
- pack_fn
- pad_fn
- random_crop_fn
- reduce_all
- reduce_all_dyn
- reduce_any
- reduce_any_dyn
- reduce_logsumexp
- reduce_logsumexp_dyn
- reduce_max
- reduce_max_dyn
- reduce_mean
- reduce_mean_dyn
- reduce_min
- reduce_min_dyn
- reduce_prod
- reduce_prod_dyn
- reduce_sum
- reduce_sum_dyn
- ReduceAxes
- ReduceAxes_dyn
- ReduceAxis
- ReduceAxis_dyn
- rename_axis_fn
- reshape_fn
- select_fn
- shuffle_batch_fn
- squeeze_fn
- tile_fn
- unpack_fn
- verify_tensor_all_finite_fn
- where_fn
- zeros_like_fn
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)
PythonClassContainer matmul(PythonClassContainer a, PythonClassContainer b, string 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 where(PythonClassContainer condition, PythonClassContainer x, PythonClassContainer y, string 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) ```