class_docstr: Stores a representation of and computes the SSKernel function.
  
  K_L(A^dt, B^dt, C) corresponding to a discretized state space,
  where A is Normal + Low Rank (NPLR)
class_docstr_tok: ["Stores","a","representation","of","and","computes","the","SSKernel","function",".","K_L","(","A^dt",",","B^dt",",","C",")","corresponding","to","a","discretized","state","space",",","where","A","is","Normal","+","Low","Rank","(","NPLR",")"]
docstr: Construct C~ from C.
  
  Two modes are supported: go directly to length L if self.L is 1,
  or length is doubled
docstr_tok: ["Construct","C~","from","C.","Two","modes","are","supported",":","go","directly","to","length","L","if","self.L","is","1",",","or","length","is","doubled"]
code: def _setup_C(self, L):
      """Construct C~ from C.
  
      Two modes are supported: go directly to length L if self.L is 1,
      or length is doubled
      """
      if self.L.item() == 0:
          if self.verbose:
              log.info(f"S4: Initializing kernel to length {L}")
          double_length = False
      elif L > self.L.item():  # 2*int(self.L) == L:
          if self.verbose:
              log.info(
                  f"S4: Doubling length from L = {self.L.item()} to {2*self.L.item()}"
              )
          double_length = True
          L = self.L.item()  # Convenience for the math below
      else:
          return
  
      C = _r2c(self.C)
      dA, _ = self._setup_state()
      dA_L = power(L, dA)
      # Multiply C by I - dA_L
      C_ = _conj(C)
      prod = contract(
          "h m n, c h n -> c h m", dA_L.transpose(-1, -2), C_
      )
      if double_length:
          prod = -prod  # Multiply by I + dA_L instead
      C_ = C_ - prod
      C_ = C_[..., : self.N]  # Take conjugate pairs again
      self.C.copy_(_c2r(C_))
  
      self.L = 2 * self.L if double_length else self.L + L
  
imports: import logging
  import math
  import os
  from functools import wraps
  from typing import Any, Callable, Optional
  import numpy
  import opt_einsum
  import torch
  import torch.nn
  import torch.nn.functional
  from einops import rearrange, repeat
  from espnet2.asr.state_spaces.components import Activation, DropoutNd, LinearActivation
label_desc: Use image node_id 1 for calling the SSKernelNPLR obj's underlying member method code with example usage: obj._setup_C(L) without return types