Parameters ---------- inputs_shape : tuple the shape of inputs tensor.
(self, inputs_shape)
| 473 | return s.format(classname=self.__class__.__name__, **self.__dict__) |
| 474 | |
| 475 | def build(self, inputs_shape): |
| 476 | """ |
| 477 | Parameters |
| 478 | ---------- |
| 479 | inputs_shape : tuple |
| 480 | the shape of inputs tensor. |
| 481 | """ |
| 482 | # if len(inputs_shape) != 2: |
| 483 | # raise ValueError('inputs must be of size (batch_size, sentence_length)') |
| 484 | |
| 485 | self.embeddings = self._get_weights( |
| 486 | "embeddings", |
| 487 | shape=(self.vocabulary_size, self.embedding_size), |
| 488 | init=self.E_init, |
| 489 | ) |
| 490 | |
| 491 | # @tf.function |
| 492 | def forward(self, inputs): |