MCPcopy Create free account
hub / github.com/Tencent/NeuralNLP-NeuralClassifier / EmbeddingProcessType

Class EmbeddingProcessType

model/embedding.py:42–59  ·  view source on GitHub ↗

Standard names for embedding mode Given the vocab tensor shape[batch_size, sequence_len]. The following keys are defined: * `FLAT`: Normal mode, return tensor shape will be * [batch_size, sequence_len, embedding_size] * `MEAN`: Mean mode, return tensor shape will be *

Source from the content-addressed store, hash-verified

40
41
42class EmbeddingProcessType(Type):
43 """Standard names for embedding mode
44 Given the vocab tensor shape[batch_size, sequence_len].
45 The following keys are defined:
46 * `FLAT`: Normal mode, return tensor shape will be
47 * [batch_size, sequence_len, embedding_size]
48 * `MEAN`: Mean mode, return tensor shape will be
49 * [batch_size, embedding_size]
50 * `SUM`: Sum mode, return tensor shape will be
51 * [batch_size, embedding_size]
52 """
53 FLAT = 'flat'
54 MEAN = 'mean'
55 SUM = 'sum'
56
57 @classmethod
58 def str(cls):
59 return ",".join([cls.FLAT, cls.MEAN, cls.SUM])
60
61
62class Embedding(torch.nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected