791e7325a985bc8dd1a213c7cd1b1e888f934074,texar/modules/embedders/embedders.py,WordEmbedder,__init__,#WordEmbedder#Any#Any#Any#,50
Before Change
if self._vocab_size is None:
self._vocab_size = self._embedding.get_shape().as_list()[0]
self._dim = self._embedding.get_shape().as_list()[1:]
if len(self._dim) == 1:
self._dim = self._dim[0]
self._built = True
After Change
self._vocab_size = vocab_size
if vocab_size is None:
self._vocab_size = self._num_embeds
if self._vocab_size != self._num_embeds:
raise ValueError(
"vocab_size must equal to init_value.shape[0]."
"Got %d and %d" % (self._vocab_size, self._num_embeds))
self._built = True
@staticmethod
def default_hparams():
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: asyml/texar
Commit Name: 791e7325a985bc8dd1a213c7cd1b1e888f934074
Time: 2018-05-27
Author: zhitinghu@gmail.com
File Name: texar/modules/embedders/embedders.py
Class Name: WordEmbedder
Method Name: __init__
Project Name: Bihaqo/t3f
Commit Name: e2f9a04f406c8f8d75708669074511479e9cb6a5
Time: 2017-04-13
Author: novikov@bayesgroup.ru
File Name: t3f/riemannian.py
Class Name:
Method Name: already_projected_scalar_products_matrix
Project Name: deepmind/sonnet
Commit Name: 2faf7acd48088783ab4d8507cc3eb1e74430b3ad
Time: 2019-08-14
Author: slebedev@google.com
File Name: sonnet/src/reshape.py
Class Name: Reshape
Method Name: _initialize