/aosp_15_r20/external/tensorflow/tensorflow/python/data/util/ |
H A D | sparse_test.py | 46 (ops.Tensor, sparse_tensor.SparseTensor), True), 48 (sparse_tensor.SparseTensor, sparse_tensor.SparseTensor), True), 49 ("TestCase_6", lambda: (((sparse_tensor.SparseTensor))), True)] 70 lambda: sparse_tensor.SparseTensor, 78 lambda: (sparse_tensor.SparseTensor), 86 (sparse_tensor.SparseTensor, ()), lambda: (tensor_shape.unknown_shape(), 89 ((), sparse_tensor.SparseTensor), lambda: ( 97 (sparse_tensor.SparseTensor, (), sparse_tensor.SparseTensor), lambda: 102 ((), sparse_tensor.SparseTensor, 123 ("TestCase_2", lambda: dtypes.int32, lambda: sparse_tensor.SparseTensor, [all …]
|
H A D | structure_test.py | 58 ("SparseTensor", lambda: sparse_tensor.SparseTensor( 77 "b": (sparse_tensor.SparseTensor( 79 sparse_tensor.SparseTensor( 126 ("SparseTensor", lambda: sparse_tensor.SparseTensor( 129 sparse_tensor.SparseTensor( 137 sparse_tensor.SparseTensor( 141 sparse_tensor.SparseTensor( 170 sparse_tensor.SparseTensor( 198 ("SparseTensor", lambda: sparse_tensor.SparseTensor( 200 lambda: sparse_tensor.SparseTensor( [all …]
|
/aosp_15_r20/external/tensorflow/tensorflow/core/util/sparse/ |
H A D | sparse_tensor.h | 42 class SparseTensor { 48 const VarDimArray order, SparseTensor* result); 51 SparseTensor* result); 54 SparseTensor* result); 57 const VarDimArray order, SparseTensor* result); 59 SparseTensor() : dims_(0) {} in SparseTensor() function 62 SparseTensor(Tensor ix, Tensor vals, const TensorShape& shape) in SparseTensor() function 63 : SparseTensor(std::move(ix), std::move(vals), TensorShapeToVector(shape), in SparseTensor() 67 SparseTensor(Tensor ix, Tensor vals, const VarDimArray shape) in SparseTensor() function 68 : SparseTensor(std::move(ix), std::move(vals), shape, in SparseTensor() [all …]
|
H A D | sparse_tensor_test.cc | 98 SparseTensor result; in TEST() 100 EXPECT_EQ(SparseTensor::Create(ix, vals, TensorShape({10, 10, 10}), {0, 1, 2}, in TEST() 111 SparseTensor result; in TEST() 113 EXPECT_EQ(SparseTensor::Create(ix, vals, TensorShape({10, 10, 10}), {0, 1, 2}, in TEST() 124 SparseTensor result; in TEST() 126 EXPECT_EQ(SparseTensor::Create(ix, vals, TensorShape({10, 10, 10}), {0, 1, 2}, in TEST() 137 SparseTensor result; in TEST() 139 EXPECT_EQ(SparseTensor::Create(ix, vals, TensorShape({10, 10, 10}), {0, 1, 2}, in TEST() 150 SparseTensor result; in TEST() 153 SparseTensor::Create(ix, vals, TensorShape({10, 10, 10}), {0, 1}, &result) in TEST() [all …]
|
H A D | sparse_tensor.cc | 41 /* static */ Status SparseTensor::Create(Tensor ix, Tensor vals, in Create() 44 SparseTensor* result) { in Create() 76 /* static */ Status SparseTensor::Create(Tensor ix, Tensor vals, in Create() 78 SparseTensor* result) { in Create() 83 /* static */ Status SparseTensor::Create(Tensor ix, Tensor vals, in Create() 85 SparseTensor* result) { in Create() 90 /* static */ Status SparseTensor::Create(Tensor ix, Tensor vals, in Create() 93 SparseTensor* result) { in Create() 98 SparseTensor::SparseTensor(Tensor ix, Tensor vals, const VarDimArray shape, in SparseTensor() function in tensorflow::sparse::SparseTensor 121 bool SparseTensor::IndicesValidVectorFastPath() const { in IndicesValidVectorFastPath() [all …]
|
H A D | README.md | 1 SparseTensor chapter 47 If the SparseTensor is constructed without a provided order, then a 51 Resorting the SparseTensor in-place (which resorts the underlying index and 87 order of the SparseTensor does not match the dimensions you wish to group by. 89 SparseTensor with 97 to sort the SparseTensor before grouping. 104 SparseTensor sp(indices, vals, shape); 131 SparseTensor sp(indices, vals, shape); 142 Concatenates multiple SparseTensors and returns a new SparseTensor. 204 SparseTensor st1(ix1, vals1, TensorShape({10, 20, 5}), {1, 0, 2}); [all …]
|
/aosp_15_r20/external/pytorch/aten/src/ATen/native/sparse/ |
H A D | SparseTensorMath.cpp | 86 SparseTensor& zero_sparse_(SparseTensor& self) { in zero_sparse_() 98 SparseTensor& mul_out_sparse_zerodim(SparseTensor& r, const SparseTensor& t, const Tensor& value) { in mul_out_sparse_zerodim() 133 SparseTensor& mul_out_sparse_scalar(SparseTensor& r, const SparseTensor& t, const Scalar& value) { in mul_out_sparse_scalar() 141 SparseTensor& neg_out_sparse(const SparseTensor& t, SparseTensor& r) { in neg_out_sparse() 151 SparseTensor neg_sparse(const SparseTensor& t) { in neg_sparse() 152 SparseTensor r = at::empty_like(t); in neg_sparse() 157 SparseTensor& neg_sparse_(SparseTensor& t) { in neg_sparse_() 167 SparseTensor& pow_out_sparse_scalar(const SparseTensor& t_, const Scalar& value, SparseTensor& r) { in pow_out_sparse_scalar() 173 SparseTensor t = t_.coalesce(); in pow_out_sparse_scalar() 185 SparseTensor pow_sparse_scalar(const SparseTensor& t, const Scalar& value) { in pow_sparse_scalar() [all …]
|
H A D | SparseTensor.cpp | 81 int64_t sparse_dim_sparse(const SparseTensor& self) { in sparse_dim_sparse() 85 int64_t dense_dim_sparse(const SparseTensor& self) { in dense_dim_sparse() 89 bool is_coalesced_sparse(const SparseTensor& self) { in is_coalesced_sparse() 98 int64_t _nnz_sparse(const SparseTensor& self) { in _nnz_sparse() 106 Tensor _indices_sparse(const SparseTensor& self) { in _indices_sparse() 110 Tensor _values_sparse(const SparseTensor& self) { in _values_sparse() 114 Tensor& _coalesced_sparse_(SparseTensor& self, bool coalesced) { in _coalesced_sparse_() 148 static SparseTensor new_sparse( in new_sparse() 172 SparseTensor new_with_dims_sparse( in new_with_dims_sparse() 180 SparseTensor self = new_sparse(dtype, layout, device, pin_memory); in new_with_dims_sparse() [all …]
|
H A D | SparseTensorMath.h | 7 TORCH_API sparse::SparseTensor& mul_out_sparse_scalar(sparse::SparseTensor& r, const sparse::Sparse… 8 TORCH_API sparse::SparseTensor& mul_out_sparse_zerodim(sparse::SparseTensor& r, const sparse::Spars… 9 TORCH_API sparse::SparseTensor& _mul_dense_sparse_out(const Tensor& d, const Tensor& s, Tensor& res… 10 TORCH_API sparse::SparseTensor& _mul_sparse_sparse_zero_dim_out(const Tensor& zero_dim, const Tenso… 11 TORCH_API sparse::SparseTensor& _mul_sparse_sparse_out(const Tensor& x, const Tensor& y, Tensor& re…
|
/aosp_15_r20/external/tensorflow/tensorflow/core/api_def/base_api/ |
H A D | api_def_DeserializeSparse.pbtxt | 6 The serialized `SparseTensor` objects. The last dimension 13 The `dtype` of the serialized `SparseTensor` objects. 16 summary: "Deserialize `SparseTensor` objects." 19 the last dimension stores serialized `SparseTensor` objects and the other N 21 `SparseTensor` objects must all match. When the final `SparseTensor` is 22 created, its rank is the rank of the incoming `SparseTensor` objects plus N; 26 The output `SparseTensor` object's shape values for the original dimensions 27 are the max across the input `SparseTensor` objects' shape values for the 30 The input `SparseTensor` objects' indices are assumed ordered in 35 original `SparseTensor` objects: [all …]
|
H A D | api_def_TakeManySparseFromTensorsMap.pbtxt | 6 1-D, The `N` serialized `SparseTensor` objects. 13 2-D. The `indices` of the minibatch `SparseTensor`. 19 1-D. The `values` of the minibatch `SparseTensor`. 25 1-D. The `shape` of the minibatch `SparseTensor`. 31 The `dtype` of the `SparseTensor` objects stored in the 54 original `SparseTensor` objects that went into the given input ops must all 55 match. When the final `SparseTensor` is created, it has rank one 56 higher than the ranks of the incoming `SparseTensor` objects 59 The output `SparseTensor` object's shape values for all dimensions but the 60 first are the max across the input `SparseTensor` objects' shape values [all …]
|
H A D | api_def_SparseToSparseSetOperation.pbtxt | 6 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major 13 1D `Tensor`, values of a `SparseTensor`. Must be in row-major 20 1D `Tensor`, shape of a `SparseTensor`. `set1_shape[0...n-1]` must 28 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major 35 1D `Tensor`, values of a `SparseTensor`. Must be in row-major 42 1D `Tensor`, shape of a `SparseTensor`. `set2_shape[0...n-1]` must 50 2D indices of a `SparseTensor`. 56 1D values of a `SparseTensor`. 62 1D `Tensor` shape of a `SparseTensor`. `result_shape[0...n-1]` is 67 summary: "Applies set operation along last dimension of 2 `SparseTensor` inputs." [all …]
|
H A D | api_def_AddManySparseToTensorsMap.pbtxt | 6 2-D. The `indices` of the minibatch `SparseTensor`. 13 1-D. The `values` of the minibatch `SparseTensor`. 19 1-D. The `shape` of the minibatch `SparseTensor`. 26 1-D. The handles of the `SparseTensor` now stored in the 43 summary: "Add an `N`-minibatch `SparseTensor` to a `SparseTensorsMap`, return `N` handles." 45 A `SparseTensor` of rank `R` is represented by three tensors: `sparse_indices`, 50 An `N`-minibatch of `SparseTensor` objects is represented as a `SparseTensor` 54 The input `SparseTensor` must have rank `R` greater than 1, and the first 55 dimension is treated as the minibatch dimension. Elements of the `SparseTensor` 57 `SparseTensor` objects pointed to by each row of the output `sparse_handles` [all …]
|
H A D | api_def_DeserializeManySparse.pbtxt | 6 2-D, The `N` serialized `SparseTensor` objects. 13 The `dtype` of the serialized `SparseTensor` objects. 20 `SerializeSparse`. The ranks of the original `SparseTensor` objects 21 must all match. When the final `SparseTensor` is created, it has rank one 22 higher than the ranks of the incoming `SparseTensor` objects 25 The output `SparseTensor` object's shape values for all dimensions but the 26 first are the max across the input `SparseTensor` objects' shape values 30 The input `SparseTensor` objects' indices are assumed ordered in 35 original `SparseTensor` objects: 50 then the final deserialized `SparseTensor` will be:
|
H A D | api_def_SparseCrossV2.pbtxt | 6 2-D. Indices of each input `SparseTensor`. 12 1-D. values of each `SparseTensor`. 18 1-D. Shapes of each `SparseTensor`. 36 2-D. Indices of the concatenated `SparseTensor`. 43 `SparseTensor`. 49 1-D. Shape of the concatenated `SparseTensor`. 54 The op takes two lists, one of 2D `SparseTensor` and one of 2D `Tensor`, each 55 representing features of one feature column. It outputs a 2D `SparseTensor` with 60 inputs[0]: SparseTensor with shape = [2, 2] 65 inputs[1]: SparseTensor with shape = [2, 1]
|
H A D | api_def_SparseCrossHashed.pbtxt | 6 2-D. Indices of each input `SparseTensor`. 12 1-D. values of each `SparseTensor`. 18 1-D. Shapes of each `SparseTensor`. 49 2-D. Indices of the concatenated `SparseTensor`. 56 `SparseTensor`. 62 1-D. Shape of the concatenated `SparseTensor`. 67 The op takes two lists, one of 2D `SparseTensor` and one of 2D `Tensor`, each 68 representing features of one feature column. It outputs a 2D `SparseTensor` with 73 inputs[0]: SparseTensor with shape = [2, 2] 78 inputs[1]: SparseTensor with shape = [2, 1]
|
H A D | api_def_SparseAdd.pbtxt | 6 2-D. The `indices` of the first `SparseTensor`, size `[nnz, ndims]` Matrix. 12 1-D. The `values` of the first `SparseTensor`, size `[nnz]` Vector. 18 1-D. The `shape` of the first `SparseTensor`, size `[ndims]` Vector. 24 2-D. The `indices` of the second `SparseTensor`, size `[nnz, ndims]` Matrix. 30 1-D. The `values` of the second `SparseTensor`, size `[nnz]` Vector. 36 1-D. The `shape` of the second `SparseTensor`, size `[ndims]` Vector. 46 summary: "Adds two `SparseTensor` objects to produce another `SparseTensor`." 48 The input `SparseTensor` objects' indices are assumed ordered in standard 52 By default, if two values sum to zero at some index, the output `SparseTensor`
|
H A D | api_def_SparseCross.pbtxt | 6 2-D. Indices of each input `SparseTensor`. 12 1-D. values of each `SparseTensor`. 18 1-D. Shapes of each `SparseTensor`. 30 2-D. Indices of the concatenated `SparseTensor`. 37 `SparseTensor`. 43 1-D. Shape of the concatenated `SparseTensor`. 69 The op takes two lists, one of 2D `SparseTensor` and one of 2D `Tensor`, each 70 representing features of one feature column. It outputs a 2D `SparseTensor` with 75 inputs[0]: SparseTensor with shape = [2, 2] 80 inputs[1]: SparseTensor with shape = [2, 1]
|
/aosp_15_r20/external/tensorflow/tensorflow/python/ops/ |
H A D | sparse_ops.py | 65 return sparse_tensor.SparseTensor.from_value(sp_input) 66 if not isinstance(sp_input, sparse_tensor.SparseTensor): 131 return sparse_tensor.SparseTensor(indices, values, shape) 236 return sparse_tensor.SparseTensor( 268 return sparse_tensor.SparseTensor( 435 return sparse_tensor.SparseTensor(output_ind, output_val, output_shape) 440 output = sparse_tensor.SparseTensor(output_ind, output_val, output_shape) 568 sparse_classes = (sparse_tensor.SparseTensor, sparse_tensor.SparseTensorValue) 590 return sparse_tensor.SparseTensor(output_ind, output_val, output_shape) 651 return sparse_tensor.SparseTensor(indices_out, values_out, shape_out) [all …]
|
/aosp_15_r20/external/tensorflow/tensorflow/python/framework/ |
H A D | sparse_tensor.py | 43 class SparseTensor(internal.NativeObject, composite_tensor.CompositeTensor): class 107 return SparseTensor( 200 return SparseTensor(self._indices, new_values, self._dense_shape) 262 _override_helper(SparseTensor, operator, func) 298 value_type = property(lambda self: SparseTensor) 335 value = SparseTensor.from_value(value) 343 return SparseTensor(*tensor_list) 357 value = SparseTensor.from_value(value) 395 return SparseTensor(indices, values, dense_shape) 414 return SparseTensor [all …]
|
H A D | sparse_tensor_test.py | 45 sparse_tensor.SparseTensor(indices, values, shape), 46 sparse_tensor.SparseTensor.from_value(sp_value), 47 sparse_tensor.SparseTensor.from_value( 48 sparse_tensor.SparseTensor(indices, values, shape))]: 71 tensor = sparse_tensor.SparseTensor( 80 sparse_tensor.is_sparse(sparse_tensor.SparseTensor([[0]], [0], [1]))) 87 sp = sparse_tensor.SparseTensor([[0, 0], [1, 2]], [1.0, 3.0], [3, 4]) 99 source = sparse_tensor.SparseTensor( 125 st = sparse_tensor.SparseTensor.from_value(sparse_tensor_value) 143 sp = sparse_tensor.SparseTensor(indices, values, dense_shape) [all …]
|
/aosp_15_r20/external/tensorflow/tensorflow/python/ops/ragged/ |
H A D | ragged_from_sparse_op_test.py | 31 st = sparse_tensor.SparseTensor( 40 st = sparse_tensor.SparseTensor( 49 st1 = sparse_tensor.SparseTensor(indices=[[0]], values=[0], dense_shape=[3]) 53 st2 = sparse_tensor.SparseTensor( 59 st3 = sparse_tensor.SparseTensor( 68 st1 = sparse_tensor.SparseTensor( 72 st2 = sparse_tensor.SparseTensor( 88 st1 = sparse_tensor.SparseTensor( 94 st2 = sparse_tensor.SparseTensor( 100 st3 = sparse_tensor.SparseTensor(
|
/aosp_15_r20/external/tensorflow/tensorflow/core/kernels/ |
H A D | sparse_tensors_map_ops.cc | 38 using sparse::SparseTensor; 52 Status AddSparseTensor(OpKernelContext* ctx, const SparseTensor& sp, in AddSparseTensor() 76 std::vector<SparseTensor>* sparse_tensors) { in RetrieveAndClearSparseTensors() 91 SparseTensor tensor; in RetrieveAndClearSparseTensors() 92 TF_RETURN_IF_ERROR(SparseTensor::Create(*ix, *values, shape, &tensor)); in RetrieveAndClearSparseTensors() 195 SparseTensor st; in Compute() 196 OP_REQUIRES_OK(context, SparseTensor::Create(*input_indices, *input_values, in Compute() 272 SparseTensor input_st; in Compute() 273 OP_REQUIRES_OK(context, SparseTensor::Create(*input_indices, *input_values, in Compute() 320 SparseTensor st_i; in Compute() [all …]
|
/aosp_15_r20/external/tensorflow/tensorflow/python/kernel_tests/sparse_ops/ |
H A D | sparse_cross_op_test.py | 58 return sparse_tensor.SparseTensor( 451 return sparse_tensor.SparseTensor( 461 st1 = sparse_tensor.SparseTensor([[0, 0]], [0], [2, 2]) 467 st2 = sparse_tensor.SparseTensor([[0, 0]], [0], [2, 2]) 473 st3 = sparse_tensor.SparseTensor([[0, 0]], [0], [2, 2]) 483 st = sparse_tensor.SparseTensor([[0]], [0], [10]) # 1D SparseTensor 492 st1 = sparse_tensor.SparseTensor([[0, 0]], [0], [10, 10]) # batch size 10 493 st2 = sparse_tensor.SparseTensor([[0, 0]], [0], [7, 10]) # batch size 7 518 out = sparse_tensor.SparseTensor(inds, vals, shapes) 544 out = sparse_tensor.SparseTensor(inds, vals, shapes) [all …]
|
H A D | sparse_ops_test.py | 45 return sparse_tensor.SparseTensor( 55 return sparse_tensor.SparseTensor( 66 return sparse_tensor.SparseTensor( 129 return (sparse_tensor.SparseTensor.from_value(indices), 130 sparse_tensor.SparseTensor.from_value(values)) 149 sparse_tensor.SparseTensor.from_value(indices_v)): 151 sparse_tensor.SparseTensor.from_value(values_v)): 210 ids = sparse_tensor.SparseTensor( 214 values = sparse_tensor.SparseTensor( 243 return ([sparse_tensor.SparseTensor.from_value(indices0), [all …]
|