Home
last modified time | relevance | path

Searched refs:embeddings (Results 1 – 25 of 46) sorted by relevance

12

/external/libtextclassifier/native/annotator/
Dquantization_test.cc41 std::vector<uint8> embeddings{{/*0: */ 0x00, 0xFF, 0x09, 0x00, in TEST() local
51 DequantizeAdd(scales.data(), embeddings.data(), bytes_per_embedding, in TEST()
69 DequantizeAdd(scales.data(), embeddings.data(), bytes_per_embedding, in TEST()
93 std::vector<uint8> embeddings(bytes_per_embedding * num_buckets); in TEST() local
95 std::fill(embeddings.begin(), embeddings.end(), 0); in TEST()
98 DequantizeAdd(scales.data(), embeddings.data(), bytes_per_embedding, in TEST()
116 std::vector<uint8> embeddings(bytes_per_embedding * num_buckets, 0xFF); in TEST() local
119 DequantizeAdd(scales.data(), embeddings.data(), bytes_per_embedding, in TEST()
137 std::vector<uint8> embeddings(bytes_per_embedding * num_buckets, 0); in TEST() local
139 embeddings[4] = (1 << 7) | (1 << 6) | (1 << 4) | 1; in TEST()
[all …]
Dquantization.cc28 void DequantizeAdd8bit(const float* scales, const uint8* embeddings, in DequantizeAdd8bit() argument
36 embeddings[bucket_id * bytes_per_embedding + k]); in DequantizeAdd8bit()
40 void DequantizeAddNBit(const float* scales, const uint8* embeddings, in DequantizeAddNBit() argument
50 uint16 data = embeddings[bucket_id * bytes_per_embedding + read16_offset]; in DequantizeAddNBit()
54 data |= embeddings[bucket_id * bytes_per_embedding + read16_offset + 1] in DequantizeAddNBit()
73 bool DequantizeAdd(const float* scales, const uint8* embeddings, in DequantizeAdd() argument
78 DequantizeAdd8bit(scales, embeddings, bytes_per_embedding, in DequantizeAdd()
81 DequantizeAddNBit(scales, embeddings, bytes_per_embedding, in DequantizeAdd()
Dmodel-executor.cc66 const TfLiteTensor* embeddings = interpreter->tensor(0); in FromBuffer() local
67 if (embeddings->dims->size != 2) { in FromBuffer()
70 int num_buckets = embeddings->dims->data[0]; in FromBuffer()
76 int bytes_per_embedding = embeddings->dims->data[1]; in FromBuffer()
85 embedding_size, scales, embeddings, std::move(interpreter), in FromBuffer()
92 const TfLiteTensor* scales, const TfLiteTensor* embeddings, in TFLiteEmbeddingExecutor() argument
101 embeddings_(embeddings), in TFLiteEmbeddingExecutor()
Dquantization.h32 bool DequantizeAdd(const float* scales, const uint8* embeddings,
Dmodel-executor.h100 const TfLiteTensor* scales, const TfLiteTensor* embeddings,
/external/tensorflow/tensorflow/python/ops/
Dembedding_ops.py511 embeddings = embedding_lookup(
513 if embeddings.dtype in (dtypes.float16, dtypes.bfloat16):
514 embeddings = math_ops.cast(embeddings, dtypes.float32)
520 if weights.dtype != embeddings.dtype:
521 weights = math_ops.cast(weights, embeddings.dtype)
523 embeddings = array_ops.gather(embeddings, idx)
527 array_ops.expand_dims(array_ops.rank(embeddings) - 1, 0), 1)
536 if embeddings.get_shape().ndims is not None:
539 [1 for _ in range(embeddings.get_shape().ndims - 1)]))
541 embeddings *= weights
[all …]
/external/libtextclassifier/native/actions/
Dactions-suggestions_test.cc1445 std::vector<float> embeddings; in TEST_F() local
1448 EXPECT_TRUE(embedder.EmbedTokensPerMessage(tokens, &embeddings, in TEST_F()
1452 EXPECT_EQ(embeddings.size(), 3); in TEST_F()
1453 EXPECT_THAT(embeddings[0], FloatEq(tc3farmhash::Fingerprint64("a", 1) % in TEST_F()
1455 EXPECT_THAT(embeddings[1], FloatEq(tc3farmhash::Fingerprint64("b", 1) % in TEST_F()
1457 EXPECT_THAT(embeddings[2], FloatEq(tc3farmhash::Fingerprint64("c", 1) % in TEST_F()
1466 std::vector<float> embeddings; in TEST_F() local
1469 EXPECT_TRUE(embedder.EmbedTokensPerMessage(tokens, &embeddings, in TEST_F()
1473 EXPECT_EQ(embeddings.size(), 5); in TEST_F()
1474 EXPECT_THAT(embeddings[0], FloatEq(tc3farmhash::Fingerprint64("a", 1) % in TEST_F()
[all …]
Dactions-suggestions.cc486 std::vector<float>* embeddings, int* max_num_tokens_per_message) const { in EmbedTokensPerMessage() argument
517 tokens[i][pos], embedding_executor_.get(), embeddings)) { in EmbedTokensPerMessage()
524 embeddings->insert(embeddings->end(), embedded_padding_token_.begin(), in EmbedTokensPerMessage()
534 std::vector<float>* embeddings, int* total_token_count) const { in EmbedAndFlattenTokens() argument
565 embeddings->insert(embeddings->end(), embedded_start_token_.begin(), in EmbedAndFlattenTokens()
573 tokens[i][pos], embedding_executor_.get(), embeddings)) { in EmbedAndFlattenTokens()
581 embeddings->insert(embeddings->end(), embedded_end_token_.begin(), in EmbedAndFlattenTokens()
592 embeddings->insert(embeddings->end(), embedded_padding_token_.begin(), in EmbedAndFlattenTokens()
Dactions-suggestions.h123 std::vector<float>* embeddings,
134 std::vector<float>* embeddings,
Dactions_model.fbs85 // embedding size) float tensor specifying the embeddings of each token of
109 // A (max tokens, embedding_size) float tensor specifying the embeddings of
152 // Serialized TensorFlow Lite model with weights for the token embeddings.
158 // Number of bits for quantization for embeddings.
/external/tensorflow/tensorflow/python/keras/layers/
Dembeddings.py142 self.embeddings = self.add_weight(
150 self.embeddings = self.add_weight(
193 if isinstance(self.embeddings, sharded_variable.ShardedVariable):
194 out = embedding_ops.embedding_lookup_v2(self.embeddings.variables, inputs)
196 out = embedding_ops.embedding_lookup_v2(self.embeddings, inputs)
Drecurrent_v2_test.py32 from tensorflow.python.keras.layers import embeddings
122 embedder = embeddings.Embedding(input_dim=vocab_size, output_dim=16)
Dserialization.py37 from tensorflow.python.keras.layers import embeddings
69 embeddings, einsum_dense, local, merge, noise, normalization,
Dembeddings_test.py145 layer.embeddings = sharded_variable.ShardedVariable(v)
/external/libtextclassifier/native/lang_id/common/flatbuffers/
Dembedding-network-params-from-flatbuffer.cc211 Matrix embeddings = GetEmbeddingMatrix(i); in ValidityChecking() local
212 if (!VerifyMatrix(embeddings, bytes)) { in ValidityChecking()
216 input_size += embedding_num_features(i) * embeddings.cols; in ValidityChecking()
Dmodel.fbs41 // parameters for a Neurosis FFNN with embeddings, or a word cluster structure,
/external/tensorflow/tensorflow/python/kernel_tests/
Dembedding_ops_test.py271 embeddings = constant_op.constant([[2.0]])
275 [embeddings], ids, max_norm=1.0)
282 embeddings = constant_op.constant([[2.0, 4.0], [3.0, 1.0]])
286 [embeddings], ids, max_norm=2.0)
289 math_ops.reduce_sum(embeddings * embeddings, axis=1))
290 normalized = embeddings / array_ops.stack([norms, norms], axis=1)
647 embeddings = constant_op.constant([[2.0]])
649 embedding = embedding_ops.embedding_lookup([embeddings], ids, max_norm=1.0)
/external/tensorflow/tensorflow/python/keras/mixed_precision/
Dlayer_correctness_test.py35 from tensorflow.python.keras.layers import embeddings
108 ('Embedding', lambda: embeddings.Embedding(4, 4),
/external/tensorflow/tensorflow/core/api_def/base_api/
Dapi_def_TPUEmbeddingActivations.pbtxt35 differentiation of graphs containing embeddings via the TPU Embedding Python
/external/tensorflow/tensorflow/lite/tools/optimize/testdata/
DREADME.md30 of mapping categorical input to embeddings.
/external/tensorflow/tensorflow/python/keras/protobuf/
Dprojector_config.proto46 repeated EmbeddingInfo embeddings = 2; field
/external/icu/icu4j/main/tests/core/src/com/ibm/icu/dev/test/bidi/
DTestBidi.java582 byte[] embeddings = new byte[2]; // all 0 in testExplicitLevel0()
584 Bidi bidi = new Bidi(text.toCharArray(), 0, embeddings, 0, text.length(), flags); in testExplicitLevel0()
589 …java.text.Bidi jb = new java.text.Bidi(text.toCharArray(), 0, embeddings, 0, text.length(), flags); in testExplicitLevel0()
/external/icu/android_icu4j/src/main/tests/android/icu/dev/test/bidi/
DTestBidi.java585 byte[] embeddings = new byte[2]; // all 0 in testExplicitLevel0()
587 Bidi bidi = new Bidi(text.toCharArray(), 0, embeddings, 0, text.length(), flags); in testExplicitLevel0()
592 …java.text.Bidi jb = new java.text.Bidi(text.toCharArray(), 0, embeddings, 0, text.length(), flags); in testExplicitLevel0()
/external/tensorflow/tensorflow/python/distribute/
Dcustom_training_loop_input_test.py758 embeddings = array_ops.gather(embedding_weights, flat_inputs)
759 embeddings = array_ops.reshape(embeddings, inputs.shape.as_list() + [128])
760 return embeddings
/external/tensorflow/tensorflow/lite/g3doc/models/text_classification/
Doverview.md113 * [Word embeddings and tutorial to train this model](https://www.tensorflow.org/tutorials/text/wo…

12