Hi and tnx for answering, i know that it see some difrent classes in every batch and make trouble in precision, but i don,t know how to solve it
The models output (qa_sinilarity) is in :

  
    
    
    Migrating from keras to pytorch 
  
  
    hi every body. please help me. 
in just want to transfer a code from keras to pytorch 
first q: is this two models are same? if not what is exact equivalence code in pytorch:) 
so: 
is this code…? 
  question = layers.Input(shape=(None,), dtype='int32', name='question')
        answer = layers.Input(shape=(None,), dtype='int32', name='answer')

        embedding = layers.Embedding(
            mask_zero=True,
            input_dim=self.vocab_size,
            output_dim=self.embedding_size,
    …
  


And the task is question answering by finding similarest question in dataset and by keras it obtain up yo 96% acc but in transfering the code into pytorch i face this problem,by this informations, can you help me more please?