(self, inputs)
| 54 | return emb |
| 55 | |
| 56 | def to_sample(self, inputs): |
| 57 | src = tf.expand_dims(inputs, -1) |
| 58 | pos = self.pos_sample_fn(inputs) |
| 59 | negs = self.neg_sample_fn(inputs) |
| 60 | assert len(negs.get_shape().as_list()) == 2 and len(pos.get_shape().as_list()) == 2 |
| 61 | return src, pos, negs |
| 62 | |
| 63 | def __call__(self, inputs): |
| 64 | src, pos, negs = self.to_sample(inputs) |