(self,
                         U: Tensor,
                         V: Tensor,
                         residual: Tensor,
                         c0: Tensor,
                         scale_val: Optional[Tensor],
                         mask_c: Optional[Tensor],
                         mask_pad: Optional[Tensor])
Apply the elementwise recurrence computation on given input
        tensors
Apply the elementwise recurrence computation on given input
        tensors
Apply the elementwise recurrence computation on given input tensors
def apply_recurrence(self,
                         U: Tensor,
                         V: Tensor,
                         residual: Tensor,
                         c0: Tensor,
                         scale_val: Optional[Tensor],
                         mask_c: Optional[Tensor],
                         mask_pad: Optional[Tensor]) -> List[Tensor]:
        """
        Apply the elementwise recurrence computation on given input
        tensors

        """
        if not torch.jit.is_scripting():
            if self.bias.is_cuda:
                return elementwise_recurrence_gpu(U, residual, V, self.bias, c0,
                                                  self.activation_type,
                                                  self.hidden_size,
                                                  self.bidirectional,
                                                  self.has_skip_term,
                                                  scale_val, mask_c, mask_pad,
                                                  self.amp_recurrence_fp16)
            else:
                return elementwise_recurrence_naive(U, residual, V, self.bias, c0,
                                                    self.activation_type,
                                                    self.hidden_size,
                                                    self.bidirectional,
                                                    self.has_skip_term,
                                                    scale_val, mask_c, mask_pad)
        else:
            return elementwise_recurrence_inference(U, residual, V, self.bias, c0,
                                                    self.activation_type,
                                                    self.hidden_size,
                                                    self.bidirectional,
                                                    self.has_skip_term,
                                                    scale_val, mask_c, mask_pad)
def apply_recurrence ( self , U : Tensor , V : Tensor , residual : Tensor , c0 : Tensor , scale_val : Optional [ Tensor ] , mask_c : Optional [ Tensor ] , mask_pad : Optional [ Tensor ] ) -> List [ Tensor ] : if not torch . jit . is_scripting ( ) : if self . bias . is_cuda : return elementwise_recurrence_gpu ( U , residual , V , self . bias , c0 , self . activation_type , self . hidden_size , self . bidirectional , self . has_skip_term , scale_val , mask_c , mask_pad , self . amp_recurrence_fp16 ) else : return elementwise_recurrence_naive ( U , residual , V , self . bias , c0 , self . activation_type , self . hidden_size , self . bidirectional , self . has_skip_term , scale_val , mask_c , mask_pad ) else : return elementwise_recurrence_inference ( U , residual , V , self . bias , c0 , self . activation_type , self . hidden_size , self . bidirectional , self . has_skip_term , scale_val , mask_c , mask_pad )