class_docstr: Main network which does cross-lingual embeddings training
docstr: Generates cross lingual embeddings
  Arguments:
       sess(tf.session): Tensorflow session
docstr_tok: ["Generates","cross","lingual","embeddings","Arguments",":","sess","(","tf.session",")",":","Tensorflow","session"]
code: def generate_xling_embed(self, sess, src_dict, tgt_dict, tgt_vec):
      """
      Generates cross lingual embeddings
      Arguments:
           sess(tf.session): Tensorflow session
      """
      print("Generating Cross-lingual embeddings...")
      src_emb_x = []
      batch_size = 512
      for i in range(0, self.vocab_size, batch_size):
          sids = [
              x for x in range(i, min(i + batch_size, self.vocab_size))
          ]
          src_emb_x.append(
              sess.run(
                  self.generator.mapWX,
                  feed_dict={self.generator.src_ph: sids},
              )
          )
      src_emb_x = np.concatenate(src_emb_x)
      print("Writing cross-lingual embeddings to file...")
      src_path = os.path.join(
          self.save_dir, "vectors-%s.txt" % self.slang
      )
      tgt_path = os.path.join(
          self.save_dir, "vectors-%s.txt" % self.tlang
      )
      with io.open(src_path, "w", encoding="utf-8") as f:
          f.write("%i %i\n" % src_emb_x.shape)
          for i in range(len(src_dict)):
              f.write(
                  "%s %s\n"
                  % (
                      src_dict[i],
                      " ".join("%.5f" % x for x in src_emb_x[i]),
                  )
              )
  
      with io.open(tgt_path, "w", encoding="utf-8") as f:
          f.write("%i %i\n" % tgt_vec.shape)
          for i in range(len(tgt_dict)):
              f.write(
                  "%s %s\n"
                  % (
                      tgt_dict[i],
                      " ".join("%.5f" % x for x in tgt_vec[i]),
                  )
              )
  
imports: from __future__ import print_function, division
  import io
  import os
  import time
  import numpy
  import scipy
  import tensorflow
label_desc: Use image node_id 11 for calling the WordTranslator obj's underlying member method code with example usage: obj.generate_xling_embed(sess, src_dict, tgt_dict, tgt_vec) without return types