parameters: (self, probs, samples)
return_statement: return final_prob.log()
docstring: Compute log prob of given samples
  
          Args:
              probs: {
                  self.cont_prob_key: [batch, 2],
                  self.prob_key [batch, num_actions]
              }
              samples: {
                  self.cont_key: [batch],
                  self.key: [batch]
              }
          return: p: [batch]
docstring_summary: Compute log prob of given samples
docstring_tokens: Compute log prob of given samples
function: def get_log_prob(self, probs, samples):
          """Compute log prob of given samples
  
          Args:
              probs: {
                  self.cont_prob_key: [batch, 2],
                  self.prob_key [batch, num_actions]
              }
              samples: {
                  self.cont_key: [batch],
                  self.key: [batch]
              }
          return: p: [batch]
          """
          cont_probs = probs[self.cont_prob_key]
          probs_ = probs[self.prob_key]
          cont_samples = samples[self.cont_key]#.float()
          samples_ = samples[self.key].clamp(min=0, max=probs_.size(0) - 1)
  
          # assert_eq(cont_samples.size(1), 1)
          # assert_eq(samples_.size(1), 1)
  
          prob = probs_.gather(1, samples_).squeeze(1)
          # cont_prob = cont_probs.gather(1, cont_samples.unsqueeze(1)).squeeze(1)
          cont_samples = cont_samples.squeeze(1).float()
          final_prob = (cont_samples * cont_probs[:, 1]
                        + (1 - cont_samples) * prob * cont_probs[:, 0])
          # print('>>>', final_prob.size())
          return final_prob.log()
function_tokens: def get_log_prob ( self , probs , samples ) : cont_probs = probs [ self . cont_prob_key ] probs_ = probs [ self . prob_key ] cont_samples = samples [ self . cont_key ] #.float() samples_ = samples [ self . key ] . clamp ( min = 0 , max = probs_ . size ( 0 ) - 1 ) # assert_eq(cont_samples.size(1), 1) # assert_eq(samples_.size(1), 1) prob = probs_ . gather ( 1 , samples_ ) . squeeze ( 1 ) # cont_prob = cont_probs.gather(1, cont_samples.unsqueeze(1)).squeeze(1) cont_samples = cont_samples . squeeze ( 1 ) . float ( ) final_prob = ( cont_samples * cont_probs [ : , 1 ] + ( 1 - cont_samples ) * prob * cont_probs [ : , 0 ] ) # print('>>>', final_prob.size()) return final_prob . log ( )