parameters: (theta)
return_statement: return R
docstring: Theta is N x 3
docstring_summary: Theta is N x 3
docstring_tokens: Theta is N x 3
function: def batch_rodrigues(theta):
      """
      Theta is N x 3
      """
      batch_size = theta.shape[0]
      xp = theta.xp
  
      angle = F.expand_dims(F.sqrt(F.batch_l2_norm_squared(theta + 1e-8)), -1)
      r = F.expand_dims(theta / F.tile(angle, 3), -1)
  
      angle = F.expand_dims(angle, -1)
      cos = F.cos(angle)
      sin = F.sin(angle)
      cos = F.tile(cos, (3, 3))
      sin = F.tile(sin, (3, 3))
  
      outer = F.matmul(r, r, transb=True)
  
      eyes = F.tile(F.expand_dims(
          Variable(xp.array(xp.eye(3), 'f')), 0), (batch_size, 1, 1))
      R = cos * eyes + (1 - cos) * outer + sin * batch_skew(r, batch_size)
      return R
function_tokens: def batch_rodrigues ( theta ) : batch_size = theta . shape [ 0 ] xp = theta . xp angle = F . expand_dims ( F . sqrt ( F . batch_l2_norm_squared ( theta + 1e-8 ) ) , - 1 ) r = F . expand_dims ( theta / F . tile ( angle , 3 ) , - 1 ) angle = F . expand_dims ( angle , - 1 ) cos = F . cos ( angle ) sin = F . sin ( angle ) cos = F . tile ( cos , ( 3 , 3 ) ) sin = F . tile ( sin , ( 3 , 3 ) ) outer = F . matmul ( r , r , transb = True ) eyes = F . tile ( F . expand_dims ( Variable ( xp . array ( xp . eye ( 3 ) , 'f' ) ) , 0 ) , ( batch_size , 1 , 1 ) ) R = cos * eyes + ( 1 - cos ) * outer + sin * batch_skew ( r , batch_size ) return R