/aosp_15_r20/external/libtextclassifier/native/utils/ |
H A D | token-feature-extractor_test.cc | 46 std::vector<int> sparse_features; in TEST_F() local 49 extractor.Extract(Token{"Hello", 0, 5}, true, &sparse_features, in TEST_F() 52 EXPECT_THAT(sparse_features, in TEST_F() 75 sparse_features.clear(); in TEST_F() 77 extractor.Extract(Token{"world!", 23, 29}, false, &sparse_features, in TEST_F() 80 EXPECT_THAT(sparse_features, in TEST_F() 116 std::vector<int> sparse_features; in TEST_F() local 119 extractor.Extract(Token{"Hello", 0, 5}, true, &sparse_features, in TEST_F() 122 EXPECT_THAT(sparse_features, in TEST_F() 126 sparse_features.clear(); in TEST_F() [all …]
|
H A D | token-feature-extractor.cc | 83 std::vector<int>* sparse_features, in Extract() argument 88 if (sparse_features) { in Extract() 89 *sparse_features = ExtractCharactergramFeatures(token); in Extract()
|
H A D | token-feature-extractor.h | 79 std::vector<int>* sparse_features,
|
/aosp_15_r20/external/tensorflow/tensorflow/core/kernels/ |
H A D | sdca_internal.cc | 66 const Example::SparseFeatures& sparse_features, in UpdateSparseDeltaWeights() argument 68 for (int64_t k = 0; k < sparse_features.indices->size(); ++k) { in UpdateSparseDeltaWeights() 70 sparse_features.values == nullptr ? 1.0 : (*sparse_features.values)(k); in UpdateSparseDeltaWeights() 71 auto it = indices_to_id_.find((*sparse_features.indices)(k)); in UpdateSparseDeltaWeights() 179 const Example::SparseFeatures& sparse_features = sparse_features_[j]; in ComputeWxAndWeightedExampleNorm() local 183 for (int64_t k = 0; k < sparse_features.indices->size(); ++k) { in ComputeWxAndWeightedExampleNorm() 184 const int64_t feature_index = (*sparse_features.indices)(k); in ComputeWxAndWeightedExampleNorm() 185 const double feature_value = sparse_features.values == nullptr in ComputeWxAndWeightedExampleNorm() 187 : (*sparse_features.values)(k); in ComputeWxAndWeightedExampleNorm() 455 Example::SparseFeatures* const sparse_features = in CreateSparseFeatureRepresentation() local [all …]
|
H A D | sdca_internal.h | 264 const Example::SparseFeatures& sparse_features,
|
/aosp_15_r20/external/libtextclassifier/native/actions/ |
H A D | feature-processor_test.cc | 35 bool AddEmbedding(const TensorView<int>& sparse_features, float* dest, in AddEmbedding() argument 38 EXPECT_THAT(sparse_features, SizeIs(1)); in AddEmbedding() 39 dest[0] = sparse_features.data()[0]; in AddEmbedding() 40 dest[1] = sparse_features.data()[0]; in AddEmbedding() 41 dest[2] = -sparse_features.data()[0]; in AddEmbedding() 42 dest[3] = -sparse_features.data()[0]; in AddEmbedding()
|
H A D | feature-processor.cc | 81 const std::vector<int>& sparse_features, in AppendFeatures() argument 91 TensorView<int>(sparse_features.data(), in AppendFeatures() 92 {static_cast<int>(sparse_features.size())}), in AppendFeatures() 109 std::vector<int> sparse_features; in AppendTokenFeatures() local 112 &sparse_features, &dense_features)) { in AppendTokenFeatures() 116 return AppendFeatures(sparse_features, dense_features, embedding_executor, in AppendTokenFeatures()
|
H A D | feature-processor.h | 43 bool AppendFeatures(const std::vector<int>& sparse_features,
|
H A D | actions-suggestions_test.cc | 1390 bool AddEmbedding(const TensorView<int>& sparse_features, float* dest, in AddEmbedding() argument 1393 EXPECT_EQ(sparse_features.size(), 1); in AddEmbedding() 1394 dest[0] = sparse_features.data()[0]; in AddEmbedding()
|
/aosp_15_r20/external/tensorflow/tensorflow/python/tpu/tests/ |
H A D | tpu_embedding_base_test.py | 195 sparse_features = (sparse_tensor.SparseTensor( 209 for sparse in sparse_features: 217 sparse_features = (sparse_features, tuple(weights)) 218 return sparse_features 222 sparse_features = self._create_sparse_data(include_weights, weight) 224 dataset = dataset_ops.DatasetV2.from_tensors(sparse_features) 234 sparse_features = ( 249 for sparse in sparse_features: 257 sparse_features = (sparse_features, tuple(weights)) 259 dataset = dataset_ops.DatasetV2.from_tensors(sparse_features) [all …]
|
H A D | tpu_embedding_v2_valid_input_test.py | 114 sparse_features = next(sparse_iter) 116 features = (sparse_features[0], ragged_features[1], sparse_features[2]) 138 sparse_features = next(sparse_iter) 139 mid_level_api.enqueue(sparse_features, training=False) 147 sparse_features)
|
/aosp_15_r20/external/pytorch/test/dynamo/ |
H A D | test_torchrec.py | 120 d1 = next(di).sparse_features.unsync() 121 d2 = next(di).sparse_features.unsync() 122 d3 = next(di).sparse_features.unsync() 133 d1 = next(di).sparse_features.sync() 134 d2 = next(di).sparse_features.sync() 135 d3 = next(di).sparse_features.sync() 145 gm = torch._dynamo.export(f)(next(di).sparse_features.unsync()).graph_module
|
/aosp_15_r20/external/pytorch/torch/testing/_internal/distributed/ |
H A D | ddp_under_dist_autograd_test.py | 74 sparse_features: torch.LongTensor 165 RemoteEM.forward, self.remote_em_rref, input.sparse_features 233 sparse_features = mini_batch.sparse_features 237 sparse_microbatch = torch.split(sparse_features, 2) 241 feature_set = FeatureSet(dense_features=d, sparse_features=s, values=v) 275 sparse_features=torch.zeros(n, dtype=torch.long), 286 training_examples.sparse_features[idx] = z 298 sparse_features=training_examples.sparse_features[
|
/aosp_15_r20/external/libtextclassifier/native/annotator/ |
H A D | model-executor.cc | 153 const TensorView<int>& sparse_features, float* dest, int dest_size) const { in AddEmbedding() argument 159 const int num_sparse_features = sparse_features.size(); in AddEmbedding() 161 const int bucket_id = sparse_features.data()[i]; in AddEmbedding()
|
H A D | model-executor.h | 70 virtual bool AddEmbedding(const TensorView<int>& sparse_features, float* dest, 86 bool AddEmbedding(const TensorView<int>& sparse_features, float* dest,
|
H A D | feature-processor_test.cc | 65 bool AddEmbedding(const TensorView<int>& sparse_features, float* dest, in AddEmbedding() argument 68 EXPECT_EQ(sparse_features.size(), 1); in AddEmbedding() 69 dest[0] = sparse_features.data()[0]; in AddEmbedding() 70 dest[1] = sparse_features.data()[0]; in AddEmbedding() 71 dest[2] = -sparse_features.data()[0]; in AddEmbedding() 72 dest[3] = -sparse_features.data()[0]; in AddEmbedding()
|
H A D | feature-processor.cc | 857 std::vector<int> sparse_features; in AppendTokenFeaturesWithCache() local 861 &sparse_features, &dense_features)) { in AppendTokenFeaturesWithCache() 872 TensorView<int>(sparse_features.data(), in AppendTokenFeaturesWithCache() 873 {static_cast<int>(sparse_features.size())}), in AppendTokenFeaturesWithCache()
|
/aosp_15_r20/external/pytorch/benchmarks/dynamo/ |
H A D | torchbench.py | 347 sparse_features=batch.sparse_features,
|