Home
last modified time | relevance | path

Searched refs:dense_shape (Results 1 – 25 of 275) sorted by relevance

1234567891011

/external/tensorflow/tensorflow/python/framework/
Dsparse_tensor_test.py51 self.assertEqual(sp.dense_shape.dtype, dtypes.int64)
57 self.assertAllEqual(shape, value.dense_shape)
61 self.assertAllEqual(sp_value.dense_shape, value.dense_shape)
72 indices=[[0, 0], [1, 2]], values=[1., 2], dense_shape=[3, 4])
100 indices=[[0, 0], [1, 2]], values=[1., 2], dense_shape=[3, 4])
104 self.assertAllEqual(new_tensor.dense_shape, source.dense_shape)
134 sparse_tensor_value.dense_shape, convertee.dense_shape)
142 dense_shape = [5, 5]
143 sp = sparse_tensor.SparseTensor(indices, values, dense_shape)
146 self.assertIsInstance(sp.dense_shape, ops.Tensor)
[all …]
Dsparse_tensor.py110 dense_shape=sparse_tensor_value.dense_shape)
112 def __init__(self, indices, values, dense_shape): argument
124 with ops.name_scope(None, "SparseTensor", [indices, values, dense_shape]):
131 dense_shape = ops.convert_to_tensor(
132 dense_shape, name="dense_shape", dtype=dtypes.int64)
133 dense_shape_default = tensor_util.constant_value_as_shape(dense_shape)
137 self._dense_shape = dense_shape
142 dense_shape_shape = dense_shape.shape.with_rank(1)
213 def dense_shape(self): member in SparseTensor
255 indices, values, dense_shape = _eval_using_default_session(
[all …]
Dindexed_slices.py64 return IndexedSlices(component_grads, value.indices, value.dense_shape)
109 def __init__(self, values, indices, dense_shape=None): argument
113 self._dense_shape = dense_shape
126 def dense_shape(self): member in IndexedSlices
174 return IndexedSlices(-self.values, self.indices, self.dense_shape)
181 dense_shape = tensor_shape.TensorShape([None]).concatenate(
185 dense_shape = dense_shape.merge_with(
189 return IndexedSlicesSpec(dense_shape, self.dtype, self._indices.dtype,
198 dense_shape = tensor_shape.TensorShape([None]).concatenate(shape[1:])
203 return IndexedSlicesSpec(dense_shape, self.dtype, self._indices.dtype,
[all …]
/external/tensorflow/tensorflow/python/kernel_tests/sparse_ops/
Dsparse_split_op_test.py91 self.assertAllEqual(sp_tensors[0].dense_shape, [2, 6])
96 self.assertAllEqual(sp_tensors[1].dense_shape, [2, 6])
108 self.assertAllEqual(sp_tensors_3[0].dense_shape, [5, 3])
112 self.assertAllEqual(sp_tensors_3[1].dense_shape, [5, 2])
116 self.assertAllEqual(sp_tensors_3[2].dense_shape, [5, 2])
123 self.assertAllEqual(sp_tensors_4[0].dense_shape, [5, 2])
127 self.assertAllEqual(sp_tensors_4[1].dense_shape, [5, 2])
131 self.assertAllEqual(sp_tensors_4[2].dense_shape, [5, 2])
134 self.assertAllEqual(sp_tensors_4[3].dense_shape, [5, 1])
146 self.assertAllEqual(sp_tensors_2[0].dense_shape, [3, 7])
[all …]
Dsparse_slice_op_test.py96 self.assertAllEqual(sp_tensor0.dense_shape, [2, 6])
101 self.assertAllEqual(sp_tensor1.dense_shape, [2, 6])
115 self.assertAllEqual(sp_tensor0.dense_shape, [5, 3])
119 self.assertAllEqual(sp_tensor1.dense_shape, [5, 2])
123 self.assertAllEqual(sp_tensor2.dense_shape, [5, 2])
132 self.assertAllEqual(sp_tensor0.dense_shape, [5, 2])
136 self.assertAllEqual(sp_tensor1.dense_shape, [5, 2])
140 self.assertAllEqual(sp_tensor2.dense_shape, [5, 2])
143 self.assertAllEqual(sp_tensor3.dense_shape, [5, 1])
156 self.assertAllEqual(sp_tensor0.dense_shape, [3, 7])
[all …]
Dsparse_cross_op_test.py66 self.assertAllEqual(sp1.dense_shape, sp2.dense_shape)
72 self.assertEqual(0, sp.dense_shape[1])
420 self.assertEqual(0, sp.dense_shape[1])
425 self.assertAllEqual(sp1.dense_shape, sp2.dense_shape)
515 shapes=[sp_inp_1.dense_shape, sp_inp_2.dense_shape],
541 shapes=[sp_inp_1.dense_shape, sp_inp_2.dense_shape],
622 shapes=[sp_inp_1.dense_shape, sp_inp_2.dense_shape],
674 shapes=[sp_inp.dense_shape],
700 sp_inp_1.dense_shape, sp_inp_2.dense_shape, sp_inp_3.dense_shape
748 sp_inp_1.dense_shape, sp_inp_2.dense_shape, sp_inp_3.dense_shape
[all …]
Dsparse_concat_op_test.py107 def _SparseTensor_NoNonZeros(self, dense_shape): argument
108 ind = np.empty(shape=(0, len(dense_shape)))
110 shape = np.array(dense_shape)
154 self.assertEqual(sp_concat.dense_shape.get_shape(), [2])
161 self.assertAllEqual(concat_out.dense_shape, [3, 3])
176 self.assertEqual(sp_concat.dense_shape.get_shape(), [2])
184 self.assertAllEqual(concat_out.dense_shape, [3, 8])
202 self.assertEqual(sp_concat.dense_shape.get_shape(), [2])
210 self.assertAllEqual(concat_out.dense_shape, np.array([5, 3]))
227 self.assertEqual(sp_concat.dense_shape.get_shape(), [2])
[all …]
Dsparse_reorder_op_test.py63 self.assertAllEqual(output_val.dense_shape, input_val.dense_shape)
75 self.assertAllEqual(output_val.dense_shape, input_val.dense_shape)
87 self.assertAllEqual(output_val.dense_shape,
88 expected_output_val.dense_shape)
102 self.assertAllEqual(output_val.dense_shape,
103 expected_output_val.dense_shape)
112 input_val.dense_shape)
128 dense_shape=[4096, 4096, 4096, 4096, 4096, 4096])
Dsparse_reshape_op_test.py100 self.assertAllEqual(output_val.dense_shape, input_val.dense_shape)
134 self.assertAllEqual(output_val.dense_shape, input_val.dense_shape)
147 self.assertAllEqual(output_val.dense_shape, input_val.dense_shape)
159 self.assertAllEqual(output_val.dense_shape, input_val.dense_shape)
173 self.assertAllEqual(output_val.dense_shape, [3, 10])
187 self.assertAllEqual(output_val.dense_shape, [3, 10])
199 self.assertAllEqual(output_val.dense_shape, [2, 3, 5])
213 self.assertAllEqual(output_val.dense_shape, [2, 3, 5])
227 self.assertAllEqual(output_val.dense_shape, [2, 3, 5])
241 self.assertAllEqual(output_val.dense_shape, [6, 4])
[all …]
/external/tensorflow/tensorflow/python/kernel_tests/linalg/sparse/
Dcsr_sparse_matrix_grad_test.py61 for dense_shape in ([53, 65, 127], [127, 65]):
62 mats_val = sparsify(np.random.randn(*dense_shape))
68 grad_vals = np.random.randn(*dense_shape).astype(np.float32)
72 self.assertEqual(grad_out.shape, dense_shape)
75 dense_shape)
85 for dense_shape in ([53, 65, 127], [127, 65]):
86 mats_val = sparsify(np.random.randn(*dense_shape))
96 indices, values, dense_shape)
112 for dense_shape in ([53, 65, 127], [127, 65]):
113 a_mats_val = sparsify(np.random.randn(*dense_shape))
[all …]
Dcsr_sparse_matrix_ops_test.py148 a_st.indices, a_st.values, a_st.dense_shape)
169 self.assertAllEqual(a_dense_shape, a_st_rt_value.dense_shape)
177 dense_shape = constant_op.constant(53, shape=[], dtype=dtypes.int64)
179 indices=indices, values=values, dense_shape=dense_shape)
185 dense_shape = constant_op.constant(53, shape=[1], dtype=dtypes.int64)
187 indices=indices, values=values, dense_shape=dense_shape)
197 dense_shape = [53, 65, 127]
198 a_mats = sparsify(np.random.randn(*dense_shape)).astype(np.float32)
235 a_st.indices, a_st.values, a_st.dense_shape)
258 self.assertAllEqual(a_dense_shape, a_st_rt_value.dense_shape)
[all …]
Dcsr_sparse_matrix_test.py54 self.assertAllEqual(a_dense_shape, a_st_rt.dense_shape)
62 dense_shape = [5, 7, 13]
63 a_mats = sparsify(np.random.randn(*dense_shape)).astype(np.float32)
82 dense_shape = [5, 7, 13]
83 a_mats = np.random.randn(*dense_shape).astype(np.float32)
95 self.assertAllEqual(dense_shape, a_sm.shape)
96 self.assertAllEqual(dense_shape, a_sm_st.dense_shape)
105 dense_shape = [5, 7, 13]
107 (np.random.randn(*dense_shape) + 1.j * np.random.randn(*dense_shape))
123 dense_shape = [5, 7, 13]
[all …]
/external/tensorflow/tensorflow/python/ops/ragged/
Dragged_from_sparse_op_test.py34 dense_shape=[4, 3])
43 dense_shape=[4, 3])
49 st1 = sparse_tensor.SparseTensor(indices=[[0]], values=[0], dense_shape=[3])
54 indices=[[0, 0, 0]], values=[0], dense_shape=[3, 3, 3])
62 dense_shape=array_ops.placeholder(dtypes.int64))
71 dense_shape=array_ops.placeholder(dtypes.int64))
75 dense_shape=[4, 3])
89 indices=[[0, 1], [0, 2], [2, 0]], values=[1, 2, 3], dense_shape=[3, 3])
95 indices=[[0, 0], [0, 1], [2, 1]], values=[1, 2, 3], dense_shape=[3, 3])
101 indices=[[0, 1], [0, 1], [0, 3]], values=[1, 2, 3], dense_shape=[3, 3])
/external/tensorflow/tensorflow/python/ops/
Dsparse_ops.py204 rank = sp_input.dense_shape.get_shape()[0]
206 rank = array_ops.shape(sp_input.dense_shape)[0]
230 shape_before = array_ops.slice(sp_input.dense_shape, [0], [axis])
231 shape_after = array_ops.slice(sp_input.dense_shape, [axis], [-1])
237 indices=indices, values=sp_input.values, dense_shape=shape)
271 dense_shape=[num_rows, num_columns])
400 shapes = [sp_input.dense_shape for sp_input in sp_inputs]
579 gen_sparse_ops.sparse_add(a.indices, a.values, a.dense_shape,
580 b.indices, b.values, b.dense_shape,
596 a.dense_shape, b)
[all …]
Dsparse_ops_test.py49 d = sparse_ops.sparse_to_dense(s.indices, s.dense_shape, s.values)
62 dense = sparse_ops.sparse_to_dense(sparse.indices, sparse.dense_shape,
71 dense_shape=[3, 4])
84 dense_shape = before.shape
93 dense_shape_t = constant_op.constant(dense_shape, dtype=dtypes.int64)
97 indices=indices_t, values=values_t, dense_shape=dense_shape_t)
103 d = sparse_ops.sparse_to_dense(s.indices, s.dense_shape, s.values)
116 dense_shape=[3, 6])
121 self.assertAllEqual(result_value.dense_shape, st.dense_shape)
129 dense_shape=[3, 6, 9])
[all …]
/external/tensorflow/tensorflow/python/training/
Dinput_test.py458 dense_shape=[2])
489 self.assertAllEqual(results[1].dense_shape, [batch_size, 2])
569 dense_shape=[1])
585 self.assertAllEqual(results[1].dense_shape, [batch_size, 1])
605 dense_shape=[1])
623 self.assertAllEqual(results[1].dense_shape, [batch_size, 1])
647 dense_shape=[2])
669 self.assertAllEqual(results[1].dense_shape, [batch_size, 2])
682 self.assertAllEqual(results[1].dense_shape, [extra_elements, 2])
703 dense_shape=[1])
[all …]
/external/tensorflow/tensorflow/python/data/kernel_tests/
Dfrom_tensor_slices_test.py98 dense_shape=np.array([3, 1])),
102 dense_shape=np.array([3, 3])))
107 [tensor_shape.TensorShape(c.dense_shape[1:]) for c in components],
114 dense_shape=np.array([1])),
118 dense_shape=np.array([3]))),
122 dense_shape=np.array([1])),
126 dense_shape=np.array([3]))),
130 dense_shape=np.array([1])),
134 dense_shape=np.array([3]))),
147 dense_shape=np.array([3, 1])),
[all …]
/external/tensorflow/tensorflow/core/kernels/sparse/
Dsparse_matrix.h146 const Tensor& dense_shape, // on host in CreateCSRSparseMatrix() argument
152 *matrix = CSRSparseMatrix(dtype, dense_shape, batch_pointers, row_pointers, in CreateCSRSparseMatrix()
209 inline Tensor& dense_shape() { in dense_shape() function
214 inline const Tensor& dense_shape() const { in dense_shape() function
222 const int64_t rows = dense_shape().vec<int64_t>()((dims() == 2) ? 0 : 1); in row_pointers_vec()
231 const int64_t rows = dense_shape().vec<int64_t>()((dims() == 2) ? 0 : 1); in row_pointers_vec()
338 Tensor dense_shape = p.tensors_[0]; in Decode() local
339 if (dense_shape.dtype() != DT_INT64) return false; in Decode()
340 if (dense_shape.dims() != 1) return false; in Decode()
341 int rank = dense_shape.dim_size(0); in Decode()
[all …]
Dcsr_sparse_matrix_to_dense_op.cc66 const Tensor& dense_shape_t = csr_sparse_matrix->dense_shape(); in Compute()
72 auto dense_shape = dense_shape_t.vec<int64_t>(); in Compute() local
73 const int64_t num_rows = dense_shape((rank == 2) ? 0 : 1); in Compute()
74 const int64_t num_cols = dense_shape((rank == 2) ? 1 : 2); in Compute()
82 OP_REQUIRES_OK(context, TensorShapeUtils::MakeShape(dense_shape.data(), in Compute()
83 dense_shape.size(), in Compute()
139 const Tensor& dense_shape_t = csr_sparse_matrix->dense_shape(); in Compute()
148 auto dense_shape = dense_shape_t.vec<int64_t>(); in Compute() local
149 const int64_t rows = dense_shape((rank == 2) ? 0 : 1); in Compute()
188 OP_REQUIRES_OK(c, coo_to_st(c, dense_shape, batch_ptrs, coo_row_ind, in Compute()
[all …]
/external/tensorflow/tensorflow/lite/kernels/internal/utils/
Dsparsity_format_converter_test.cc27 const std::vector<int> dense_shape = {3, 4}; in TEST() local
31 FormatConverter<int> converter(dense_shape, traversal_order, format); in TEST()
56 const std::vector<int> dense_shape = {3, 4}; in TEST() local
60 FormatConverter<int> converter(dense_shape, traversal_order, format); in TEST()
87 const std::vector<int> dense_shape = {3, 4}; in TEST() local
91 FormatConverter<int> converter(dense_shape, traversal_order, format); in TEST()
118 const std::vector<int> dense_shape = {3, 4}; in TEST() local
122 FormatConverter<int> converter(dense_shape, traversal_order, format); in TEST()
151 const std::vector<int> dense_shape = {3, 4}; in TEST() local
155 FormatConverter<int> converter(dense_shape, traversal_order, format); in TEST()
[all …]
/external/tensorflow/tensorflow/python/data/util/
Dsparse_test.py164 indices=[[0]], values=[1], dense_shape=[1]),
168 (sparse_tensor.SparseTensor(indices=[[0]], values=[1], dense_shape=[1])),
172 (sparse_tensor.SparseTensor(indices=[[0]], values=[1], dense_shape=[1]),
176 sparse_tensor.SparseTensor(indices=[[0]], values=[1], dense_shape=[1])),
183 (sparse_tensor.SparseTensor(indices=[[0]], values=[1], dense_shape=[1]),
188 sparse_tensor.SparseTensor(indices=[[0]], values=[1], dense_shape=[1]),
208 indices=[[0, 0]], values=[1], dense_shape=[1, 1])),
210 indices=[[3, 4]], values=[-1], dense_shape=[4, 5])),
212 indices=[[0, 0], [3, 4]], values=[1, -1], dense_shape=[4, 5])),
214 indices=[[0, 0]], values=[1], dense_shape=[1, 1]))),
[all …]
/external/tensorflow/tensorflow/lite/testing/op_tests/
Dsparse_to_dense.py38 def generate_index(dense_shape): argument
39 if len(dense_shape) == 1:
40 return np.random.randint(dense_shape[0])
43 for shape in dense_shape:
49 dense_shape = parameters["dense_shape"]
63 indices.add(generate_index(dense_shape))
68 dense_shape,
/external/tensorflow/tensorflow/core/ops/
Dsparse_csr_matrix_ops.cc69 ShapeHandle dense_shape; in __anon6adce4610102() local
70 TF_RETURN_IF_ERROR(c->MakeShapeFromShapeTensor(2, &dense_shape)); in __anon6adce4610102()
71 TF_RETURN_IF_ERROR(c->WithRank(dense_shape, rank, &dense_shape)); in __anon6adce4610102()
72 if (!c->RankKnown(dense_shape) || c->Rank(dense_shape) < 2 || in __anon6adce4610102()
73 c->Rank(dense_shape) > 3) { in __anon6adce4610102()
75 "Invalid rank: ", c->Rank(dense_shape), in __anon6adce4610102()
83 {ShapeAndType{dense_shape, dtype}}); in __anon6adce4610102()
104 ShapeHandle dense_shape = c->Vector(rank); in __anon6adce4610202() local
107 c->set_output(2, dense_shape); in __anon6adce4610202()
117 ShapeHandle dense_shape = c->input(0); in __anon6adce4610302() local
[all …]
/external/tensorflow/tensorflow/python/feature_column/
Dfeature_column_test.py174 dense_shape=[0],
178 self.assertAllEqual(np.array([0, 1], dtype=np.int64), spv.dense_shape)
327 indices=[[0, 0]], values=[0.3], dense_shape=[1, 1])
491 self.assertAllEqual([4, 1], id_tensor_value.dense_shape)
508 self.assertAllEqual([2, 2], id_tensor_value.dense_shape)
516 indices=[[0, 0]], values=[0.3], dense_shape=[1, 1])
712 dense_shape=[1, 2]), self.evaluate(features['aaa']))
719 dense_shape=[2, 2])
728 self.assertAllEqual(wire_tensor.dense_shape, output.dense_shape)
740 dense_shape=[1, 1])
[all …]
Dfeature_column_v2_test.py246 dense_shape=[0],
251 self.assertAllEqual(np.array([0, 1], dtype=np.int64), spv.dense_shape)
413 indices=[[0, 0]], values=[0.3], dense_shape=[1, 1])
617 self.assertAllEqual([4, 1], id_tensor_value.dense_shape)
637 self.assertAllEqual([2, 2], id_tensor_value.dense_shape)
645 indices=[[0, 0]], values=[0.3], dense_shape=[1, 1])
848 dense_shape=[1, 2]), self.evaluate(features['aaa']))
855 dense_shape=[2, 2])
868 self.evaluate(wire_tensor.dense_shape),
869 self.evaluate(output.dense_shape))
[all …]

1234567891011