Home | History | Annotate | Download | only in ragged
      1 # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
      4 # you may not use this file except in compliance with the License.
      5 # You may obtain a copy of the License at
      6 #
      7 #     http://www.apache.org/licenses/LICENSE-2.0
      8 #
      9 # Unless required by applicable law or agreed to in writing, software
     10 # distributed under the License is distributed on an "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     14 # ==============================================================================
     15 """Ragged Tensors.
     16 
     17 This package defines ops for manipulating ragged tensors (`tf.RaggedTensor`),
     18 which are tensors with non-uniform shapes.  In particular, each `RaggedTensor`
     19 has one or more *ragged dimensions*, which are dimensions whose slices may have
     20 different lengths.  For example, the inner (column) dimension of
     21 `rt=[[3, 1, 4, 1], [], [5, 9, 2], [6], []]` is ragged, since the column slices
     22 (`rt[0, :]`, ..., `rt[4, :]`) have different lengths.  For a more detailed
     23 description of ragged tensors, see the `tf.RaggedTensor` class documentation
     24 and the [Ragged Tensor Guide](/guide/ragged_tensors).
     25 """
     26 
     27 from __future__ import absolute_import
     28 from __future__ import division
     29 from __future__ import print_function
     30 
     31 from tensorflow.python.ops.ragged import ragged_array_ops
     32 from tensorflow.python.ops.ragged import ragged_batch_gather_ops
     33 from tensorflow.python.ops.ragged import ragged_batch_gather_with_default_op
     34 from tensorflow.python.ops.ragged import ragged_concat_ops
     35 from tensorflow.python.ops.ragged import ragged_conversion_ops
     36 from tensorflow.python.ops.ragged import ragged_dispatch
     37 from tensorflow.python.ops.ragged import ragged_factory_ops
     38 from tensorflow.python.ops.ragged import ragged_functional_ops
     39 from tensorflow.python.ops.ragged import ragged_gather_ops
     40 from tensorflow.python.ops.ragged import ragged_getitem
     41 from tensorflow.python.ops.ragged import ragged_map_ops
     42 from tensorflow.python.ops.ragged import ragged_math_ops
     43 from tensorflow.python.ops.ragged import ragged_operators
     44 from tensorflow.python.ops.ragged import ragged_string_ops
     45 from tensorflow.python.ops.ragged import ragged_tensor
     46 from tensorflow.python.ops.ragged import ragged_tensor_shape
     47 from tensorflow.python.ops.ragged import ragged_tensor_value
     48 from tensorflow.python.ops.ragged import ragged_where_op
     49 from tensorflow.python.ops.ragged import segment_id_ops
     50 
     51 # Add a list of the ops that support Ragged Tensors.
     52 __doc__ += ragged_dispatch.ragged_op_list()  # pylint: disable=redefined-builtin
     53