class_docstr: Linear time regression fun and some not so linear fun.
  A modular model that models classic time-series components
      * trend
      * seasonality
      * auto-regression (as AR-Net)
      * covariates (as AR-Net)
      * apriori regressors
      * events and holidays
  by using Neural Network components.
  The Auto-regression and covariate components can be configured as a deeper network (AR-Net).
class_docstr_tok: ["Linear","time","regression","fun","and","some","not","so","linear","fun",".","A","modular","model","that","models","classic","time-series","components","*","trend","*","seasonality","*","auto-regression","(","as","AR-Net",")","*","covariates","(","as","AR-Net",")","*","apriori","regressors","*","events","and","holidays","by","using","Neural","Network","components",".","The","Auto-regression","and","covariate","components","can","be","configured","as","a","deeper","network","(","AR-Net",")","."]
docstr: Get attributions of covariates network w.r.t. the model input.
docstr_tok: ["Get","attributions","of","covariates","network","w.r.t",".","the","model","input","."]
code: def get_covar_weights(self, covar_input=None) -> torch.Tensor:
      """
      Get attributions of covariates network w.r.t. the model input.
      """
      if self.config_lagged_regressors is not None:
          # Accumulate the lags of the covariates
          covar_splits = np.add.accumulate(
              [
                  covar.n_lags
                  for _, covar in self.config_lagged_regressors.items()
              ][:-1]
          ).tolist()
          # If actual covariates are provided, use them to compute the attributions
          if covar_input is not None:
              covar_input = torch.cat(
                  [covar for _, covar in covar_input.items()], axis=1
              )
          # Calculate the attributions w.r.t. the inputs
          if self.lagged_reg_layers == []:
              attributions = self.covar_net[0].weight
          else:
              attributions = interprete_model(
                  self, "covar_net", "forward_covar_net", covar_input
              )
          # Split the attributions into the different covariates
          attributions_split = torch.tensor_split(
              attributions,
              covar_splits,
              axis=1,
          )
          # Combine attributions and covariate name
          covar_attributions = dict(
              zip(
                  self.config_lagged_regressors.keys(),
                  attributions_split,
              )
          )
      else:
          covar_attributions = None
      return covar_attributions
  
imports: import logging
  import math
  from collections import OrderedDict
  from functools import reduce
  from typing import Dict, List, Optional, Union
  import numpy
  import pytorch_lightning
  import torch
  import torch.nn
  import torchmetrics
  from neuralprophet import configure, np_types
  from neuralprophet.components.router import get_future_regressors, get_seasonality, get_trend
  from neuralprophet.utils import check_for_regularization, config_events_to_model_dims, reg_func_events, reg_func_regressors, reg_func_season, reg_func_trend
  from neuralprophet.utils_torch import init_parameter, interprete_model
label_desc: Use image node_id 3 for calling the TimeNet obj's underlying member method code with example usage: obj.get_covar_weights(covar_input) and returns: covar_attributions