Home
last modified time | relevance | path

Searched refs:indices (Results 1 – 25 of 1968) sorted by relevance

12345678910>>...79

/external/tensorflow/tensorflow/python/ops/ragged/
Dragged_gather_ops.py36 def gather(params, indices, validate_indices=None, axis=0, batch_dims=0, argument
94 with ops.name_scope(name, 'RaggedGather', [params, indices]):
97 indices = ragged_tensor.convert_to_tensor_or_ragged_tensor(
98 indices, name='indices')
100 if ragged_tensor.is_ragged(indices):
101 return indices.with_values(gather(params, indices.values))
104 return array_ops.gather(params, indices)
106 indices = ops.convert_to_tensor(indices)
107 if indices.shape.ndims is None:
111 indices=indices,
[all …]
Dragged_batch_gather_op_test.py49 indices=ragged_factory_ops.constant_value([[1, 2, 0], [], [], [0,
59 indices=[3, 2],
65 indices=[3, 2],
73 indices=[[2, 0], [0, 1], [1, 0]],
79 indices=[[2, 0], [0, 1], [0, 0]],
84 indices=ragged_factory_ops.constant_value([[2, 0, 2], [0], [1]]),
93 indices=[[1, 0], [0, 1], [0, 0]],
105 indices=[[[2, 0]], [[0, 1]], [[1, 0]]],
113 indices=ragged_factory_ops.constant_value(
122 indices=ragged_factory_ops.constant_value(
[all …]
Dragged_gather_nd_op_test.py50 indices=[[2], [0]],
56 indices=[[2, 1], [0, 0]],
62 indices=[[0, 0, 1], [1, 1, 2]],
70 indices=np.zeros([0], dtype=np.int32),
76 indices=np.zeros([3, 0], dtype=np.int32),
85 indices=np.zeros([1, 3, 0], dtype=np.int32),
93 indices=ragged_factory_ops.constant_value(
106 indices=[[1], [0]],
114 indices=[[1], [1]],
121 indices=ragged_factory_ops.constant_value([[[0]]], ragged_rank=1),
[all …]
Dragged_batch_gather_ops.py35 def batch_gather(params, indices, name=None): argument
67 if not (ragged_tensor.is_ragged(params) or ragged_tensor.is_ragged(indices)):
68 return array_ops.batch_gather(params, indices, name)
70 with ops.name_scope(name, 'RaggedBatchGather', [params, indices]):
73 indices = ragged_tensor.convert_to_tensor_or_ragged_tensor(
74 indices, name='indices')
75 indices_ndims = indices.shape.ndims
82 if ragged_tensor.is_ragged(indices):
88 checks = [check_ops.assert_equal(params.row_splits, indices.row_splits)]
91 batch_gather(params.values, indices.values), indices.row_splits)
[all …]
Dragged_gather_op_test.py38 indices = constant_op.constant([3, 1, 2, 1, 0])
46 ragged_gather_ops.gather(ragged_params, indices),
54 indices = [2, 0, 2, 1]
56 ragged_gather_ops.gather(params, indices), [b'c', b'a', b'c', b'b'])
57 self.assertIsInstance(ragged_gather_ops.gather(params, indices), ops.Tensor)
62 indices = [2, 0, 2, 1]
64 ragged_gather_ops.gather(params, indices),
69 indices = ragged_factory_ops.constant([[2, 1], [1, 2, 0], [3]])
71 ragged_gather_ops.gather(params, indices),
77 indices = ragged_factory_ops.constant([[2, 1], [1, 2, 0], [3]])
[all …]
/external/tensorflow/tensorflow/python/kernel_tests/
Done_hot_op_test.py56 indices = np.asarray([0, 2, -1, 1], dtype=np.int64)
68 indices=indices,
77 indices=indices,
86 indices = np.asarray([0, 2, -1, 1], dtype=np.int64)
94 self._testBothOneHot(indices=indices, depth=depth, truth=truth)
98 indices=indices, depth=depth, axis=0,
126 indices = np.asarray([[0, 2, -1, 1], [1, 0, 1, -1]], dtype=np.int64)
139 indices=indices,
148 indices=indices,
157 indices = np.asarray([[0, 2, -1, 1], [1, 0, 1, -1]], dtype=np.int64)
[all …]
Dscatter_nd_ops_test.py62 def _NumpyScatterNd(ref, indices, updates, op): argument
63 ixdim = indices.shape[-1]
64 num_updates = indices.size // ixdim
69 flat_indices = _FlatInnerDims(indices)
79 def _NumpyUpdate(ref, indices, updates): argument
80 return _NumpyScatterNd(ref, indices, updates, lambda p, u: u)
83 def _NumpyAdd(ref, indices, updates): argument
84 return _NumpyScatterNd(ref, indices, updates, lambda p, u: p + u)
87 def _NumpySub(ref, indices, updates): argument
88 return _NumpyScatterNd(ref, indices, updates, lambda p, u: p - u)
[all …]
Dscatter_ops_test.py35 def _NumpyAdd(ref, indices, updates): argument
38 for i, indx in np.ndenumerate(indices):
42 def _NumpyAddScalar(ref, indices, update): argument
43 for _, indx in np.ndenumerate(indices):
47 def _NumpySub(ref, indices, updates): argument
48 for i, indx in np.ndenumerate(indices):
52 def _NumpySubScalar(ref, indices, update): argument
53 for _, indx in np.ndenumerate(indices):
57 def _NumpyMul(ref, indices, updates): argument
58 for i, indx in np.ndenumerate(indices):
[all …]
Dgather_op_test.py51 for indices in 4, [1, 2, 2, 4, 5]:
54 indices_tf = constant_op.constant(indices)
57 np_val = params_np[indices]
69 indices = constant_op.constant(2)
70 gather_t = array_ops.gather(params, indices, axis=axis)
85 indices = constant_op.constant([0, 1, 0, 2])
86 gather_t = array_ops.gather(params, indices, axis=axis)
101 indices = np.random.randint(shape[axis], size=indices_shape)
104 tf_indices = constant_op.constant(indices)
113 gather_np = np.take(params, indices, axis)
[all …]
Ddynamic_stitch_op_test.py41 indices = [constant_op.constant(0), constant_op.constant(1)]
44 stitched_t = self.stitch_op(indices[::step], data)
53 indices = [
59 stitched_t = self.stitch_op(indices[::step], data)
72 indices = [
81 stitched_t = self.stitch_op(indices, data)
88 indices = [constant_op.constant([1, 6, 2, 3, 5, 0, 4, 7])]
90 stitched_t = self.stitch_op(indices, data)
97 indices = [
107 stitched_t = self.stitch_op(indices, data)
[all …]
Dstring_split_op_test.py38 indices, values, shape = self.evaluate(tokens)
39 self.assertAllEqual(indices, [[0, 0], [0, 1], [0, 2], [0, 3], [1, 0]])
49 indices, values, shape = self.evaluate(tokens)
50 self.assertAllEqual(indices, [[0, 0], [0, 1], [0, 2], [0, 3], [0, 4],
67 indices, values, shape = self.evaluate(tokens)
69 indices,
79 indices, values, shape = self.evaluate(tokens)
81 indices,
98 indices, values, shape = self.evaluate(tokens)
99 self.assertAllEqual(indices, [[0, 0], [0, 1], [1, 0]])
[all …]
/external/tensorflow/tensorflow/compiler/tests/
Dscatter_nd_op_test.py49 def _NumpyScatterNd(ref, indices, updates, op): argument
50 ixdim = indices.shape[-1]
51 num_updates = indices.size // ixdim
56 flat_indices = _FlatInnerDims(indices)
66 def _NumpyUpdate(indices, updates, shape): argument
68 return _NumpyScatterNd(ref, indices, updates, lambda p, u: u)
94 indices = np.array(all_indices[:num_updates])
97 indices = indices[:num_updates // 2]
99 indices = np.append(
100 indices, [indices[np.random.randint(num_updates // 2)]], axis=0)
[all …]
/external/python/cpython3/Lib/test/
Dtest_slice.py144 actual = slice.indices(length)
154 actual = range(*slice.indices(length))
159 self.assertEqual(slice(None ).indices(10), (0, 10, 1))
160 self.assertEqual(slice(None, None, 2).indices(10), (0, 10, 2))
161 self.assertEqual(slice(1, None, 2).indices(10), (1, 10, 2))
162 self.assertEqual(slice(None, None, -1).indices(10), (9, -1, -1))
163 self.assertEqual(slice(None, None, -2).indices(10), (9, -1, -2))
164 self.assertEqual(slice(3, None, -2).indices(10), (3, -1, -2))
166 self.assertEqual(slice(None, -9).indices(10), (0, 1, 1))
167 self.assertEqual(slice(None, -10).indices(10), (0, 0, 1))
[all …]
/external/eigen/unsupported/Eigen/CXX11/src/Tensor/
DTensorRef.h201 const array<Index, num_indices> indices{{firstIndex, otherIndices...}}; in operator()
202 return coeff(indices); in operator()
208 const array<Index, num_indices> indices{{firstIndex, otherIndices...}}; in coeffRef()
209 return coeffRef(indices); in coeffRef()
216 array<Index, 2> indices; in operator() local
217 indices[0] = i0; in operator()
218 indices[1] = i1; in operator()
219 return coeff(indices); in operator()
224 array<Index, 3> indices; in operator() local
225 indices[0] = i0; in operator()
[all …]
/external/tensorflow/tensorflow/lite/tools/optimize/
Dquantization_utils.cc90 int indices[4]; in SymmetricPerChannelQuantization() local
95 for (indices[0] = 0; indices[0] < dimension[0]; indices[0]++) { in SymmetricPerChannelQuantization()
96 for (indices[1] = 0; indices[1] < dimension[1]; indices[1]++) { in SymmetricPerChannelQuantization()
97 for (indices[2] = 0; indices[2] < dimension[2]; indices[2]++) { in SymmetricPerChannelQuantization()
98 for (indices[3] = 0; indices[3] < dimension[3]; indices[3]++) { in SymmetricPerChannelQuantization()
99 int channel_idx = indices[channel_dim_index]; in SymmetricPerChannelQuantization()
100 const float val = input[Offset(tensor_dims, indices)]; in SymmetricPerChannelQuantization()
142 int indices[4]; in SymmetricPerChannelQuantizeValues() local
145 for (indices[0] = 0; indices[0] < dimension[0]; indices[0]++) { in SymmetricPerChannelQuantizeValues()
146 for (indices[1] = 0; indices[1] < dimension[1]; indices[1]++) { in SymmetricPerChannelQuantizeValues()
[all …]
/external/libopus/silk/
Ddecode_indices.c56 psDec->indices.signalType = (opus_int8)silk_RSHIFT( Ix, 1 ); in silk_decode_indices()
57 psDec->indices.quantOffsetType = (opus_int8)( Ix & 1 ); in silk_decode_indices()
65 … psDec->indices.GainsIndices[ 0 ] = (opus_int8)ec_dec_icdf( psRangeDec, silk_delta_gain_iCDF, 8 ); in silk_decode_indices()
68 …psDec->indices.GainsIndices[ 0 ] = (opus_int8)silk_LSHIFT( ec_dec_icdf( psRangeDec, silk_gain_iCD… in silk_decode_indices()
69 … psDec->indices.GainsIndices[ 0 ] += (opus_int8)ec_dec_icdf( psRangeDec, silk_uniform8_iCDF, 8 ); in silk_decode_indices()
74 … psDec->indices.GainsIndices[ i ] = (opus_int8)ec_dec_icdf( psRangeDec, silk_delta_gain_iCDF, 8 ); in silk_decode_indices()
80 …psDec->indices.NLSFIndices[ 0 ] = (opus_int8)ec_dec_icdf( psRangeDec, &psDec->psNLSF_CB->CB1_iCDF[… in silk_decode_indices()
81 silk_NLSF_unpack( ec_ix, pred_Q8, psDec->psNLSF_CB, psDec->indices.NLSFIndices[ 0 ] ); in silk_decode_indices()
90 psDec->indices.NLSFIndices[ i+1 ] = (opus_int8)( Ix - NLSF_QUANT_MAX_AMPLITUDE ); in silk_decode_indices()
95 …psDec->indices.NLSFInterpCoef_Q2 = (opus_int8)ec_dec_icdf( psRangeDec, silk_NLSF_interpolation_fac… in silk_decode_indices()
[all …]
/external/tensorflow/tensorflow/core/api_def/base_api/
Dapi_def_GatherNd.pbtxt10 name: "indices"
18 Values from `params` gathered from indices given by `indices`, with
19 shape `indices.shape[:-1] + params.shape[indices.shape[-1]:]`.
22 summary: "Gather slices from `params` into a Tensor with shape specified by `indices`."
24 `indices` is an K-dimensional integer tensor, best thought of as a
25 (K-1)-dimensional tensor of indices into `params`, where each element defines a
28 output[\\(i_0, ..., i_{K-2}\\)] = params[indices[\\(i_0, ..., i_{K-2}\\)]]
30 Whereas in `tf.gather` `indices` defines slices into the first
31 dimension of `params`, in `tf.gather_nd`, `indices` defines slices into the
32 first `N` dimensions of `params`, where `N = indices.shape[-1]`.
[all …]
/external/tensorflow/tensorflow/contrib/factorization/python/ops/
Dfactorization_ops_test_utils.py66 indices = np.nonzero(np_matrix)
73 [np.where(indices[0] == r)[0] for r in row_slices], 0)
74 indices = (indices[0][selected_ind], indices[1][selected_ind])
78 [np.where(indices[1] == c)[0] for c in col_slices], 0)
79 indices = (indices[0][selected_ind], indices[1][selected_ind])
82 shuffled_ind = [x for x in range(len(indices[0]))]
84 indices = (indices[0][shuffled_ind], indices[1][shuffled_ind])
86 ind = (np.concatenate((np.expand_dims(indices[1], 1),
87 np.expand_dims(indices[0], 1)), 1).astype(np.int64) if
88 transpose else np.concatenate((np.expand_dims(indices[0], 1),
[all …]
/external/python/cpython2/Lib/test/
Dtest_slice.py80 self.assertEqual(slice(None ).indices(10), (0, 10, 1))
81 self.assertEqual(slice(None, None, 2).indices(10), (0, 10, 2))
82 self.assertEqual(slice(1, None, 2).indices(10), (1, 10, 2))
83 self.assertEqual(slice(None, None, -1).indices(10), (9, -1, -1))
84 self.assertEqual(slice(None, None, -2).indices(10), (9, -1, -2))
85 self.assertEqual(slice(3, None, -2).indices(10), (3, -1, -2))
87 self.assertEqual(slice(None, -9).indices(10), (0, 1, 1))
88 self.assertEqual(slice(None, -10).indices(10), (0, 0, 1))
89 self.assertEqual(slice(None, -11).indices(10), (0, 0, 1))
90 self.assertEqual(slice(None, -10, -1).indices(10), (9, 0, -1))
[all …]
/external/mesa3d/src/gallium/drivers/softpipe/
Dsp_prim_vbuf.c160 sp_vbuf_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) in sp_vbuf_draw_elements() argument
174 get_vert(vertex_buffer, indices[i-0], stride) ); in sp_vbuf_draw_elements()
181 get_vert(vertex_buffer, indices[i-1], stride), in sp_vbuf_draw_elements()
182 get_vert(vertex_buffer, indices[i-0], stride) ); in sp_vbuf_draw_elements()
189 get_vert(vertex_buffer, indices[i-1], stride), in sp_vbuf_draw_elements()
190 get_vert(vertex_buffer, indices[i-0], stride) ); in sp_vbuf_draw_elements()
197 get_vert(vertex_buffer, indices[i-1], stride), in sp_vbuf_draw_elements()
198 get_vert(vertex_buffer, indices[i-0], stride) ); in sp_vbuf_draw_elements()
202 get_vert(vertex_buffer, indices[nr-1], stride), in sp_vbuf_draw_elements()
203 get_vert(vertex_buffer, indices[0], stride) ); in sp_vbuf_draw_elements()
[all …]
/external/mesa3d/src/gallium/drivers/llvmpipe/
Dlp_setup_vbuf.c136 lp_setup_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) in lp_setup_draw_elements() argument
153 get_vert(vertex_buffer, indices[i-0], stride) ); in lp_setup_draw_elements()
160 get_vert(vertex_buffer, indices[i-1], stride), in lp_setup_draw_elements()
161 get_vert(vertex_buffer, indices[i-0], stride) ); in lp_setup_draw_elements()
168 get_vert(vertex_buffer, indices[i-1], stride), in lp_setup_draw_elements()
169 get_vert(vertex_buffer, indices[i-0], stride) ); in lp_setup_draw_elements()
176 get_vert(vertex_buffer, indices[i-1], stride), in lp_setup_draw_elements()
177 get_vert(vertex_buffer, indices[i-0], stride) ); in lp_setup_draw_elements()
181 get_vert(vertex_buffer, indices[nr-1], stride), in lp_setup_draw_elements()
182 get_vert(vertex_buffer, indices[0], stride) ); in lp_setup_draw_elements()
[all …]
/external/tensorflow/tensorflow/python/ops/
Dstate_ops.py252 def scatter_update(ref, indices, updates, use_locking=True, name=None): argument
298 return gen_state_ops.scatter_update(ref, indices, updates,
301 ref.handle, indices, ops.convert_to_tensor(updates, ref.dtype),
306 def scatter_nd_update(ref, indices, updates, use_locking=True, name=None): argument
361 ref, indices, updates, use_locking, name)
363 ref.handle, indices, ops.convert_to_tensor(updates, ref.dtype),
368 def scatter_add(ref, indices, updates, use_locking=False, name=None): argument
412 return gen_state_ops.scatter_add(ref, indices, updates,
415 ref.handle, indices, ops.convert_to_tensor(updates, ref.dtype),
420 def scatter_nd_add(ref, indices, updates, use_locking=False, name=None): argument
[all …]
/external/eigen/Eigen/src/Core/
DTranspositions.h33 indices() = other.indices();
43 indices() = other.indices();
49 Index size() const { return indices().size(); } in size()
51 Index rows() const { return indices().size(); } in rows()
53 Index cols() const { return indices().size(); } in cols()
56 inline const StorageIndex& coeff(Index i) const { return indices().coeff(i); } in coeff()
58 inline StorageIndex& coeffRef(Index i) { return indices().coeffRef(i); } in coeffRef()
60 inline const StorageIndex& operator()(Index i) const { return indices()(i); } in operator()
62 inline StorageIndex& operator()(Index i) { return indices()(i); } in operator()
64 inline const StorageIndex& operator[](Index i) const { return indices()(i); }
[all …]
/external/tensorflow/tensorflow/lite/kernels/
Dgather_nd.cc35 const TfLiteTensor* indices = GetInput(context, node, kIndices); in Prepare() local
51 switch (indices->type) { in Prepare()
58 TfLiteTypeGetName(indices->type)); in Prepare()
63 const int indices_rank = NumDimensions(indices); in Prepare()
64 const int indices_nd = SizeOfDimension(indices, indices_rank - 1); in Prepare()
88 output_shape->data[output_index++] = indices->dims->data[i]; in Prepare()
97 TfLiteStatus GatherNd(const TfLiteTensor* params, const TfLiteTensor* indices, in GatherNd() argument
101 GetTensorShape(indices), GetTensorData<IndicesT>(indices), in GatherNd()
108 const TfLiteTensor* indices, TfLiteTensor* output) { in EvalGatherNd() argument
111 return GatherNd<float, IndicesT>(params, indices, output); in EvalGatherNd()
[all …]
/external/python/cpython3/Lib/idlelib/
Dparenmatch.py78 indices = (HyperParser(self.editwin, "insert")
80 self.finish_paren_event(indices)
92 indices = hp.get_surrounding_brackets(_openers[closer], True)
93 self.finish_paren_event(indices)
96 def finish_paren_event(self, indices): argument
97 if indices is None and self.BELL:
102 self.tagfuncs.get(self.STYLE, self.create_tag_expression)(self, indices)
120 def create_tag_opener(self, indices): argument
122 self.text.tag_add("paren", indices[0])
125 def create_tag_parens(self, indices): argument
[all …]

12345678910>>...79