indices = np.array([(i, len(batch[i]) if i < len(batch) else 0)
for i in range(self.batch_size)])
embeddings = self.predict_on_generator(
[[(features, indices, self.get_global_step()), None, None]],
outputs=self._embedding)
for i in range(len(batch)):
result.append(embeddings[i])
After Change
indices = np.array([(i, len(batch[i]) if i < len(batch) else 0)
for i in range(self.batch_size)])
embeddings = self.predict_on_generator(
[[(features, indices, np.array(self.get_global_step())), None, None]],
outputs=self._embedding)
for i in range(len(batch)):
result.append(embeddings[i])