code: def test_llm_attr(self) -> None:
      llm = DummyLLM()
      llm.to(self.device)
      tokenizer = DummyTokenizer()
      attr = LayerIntegratedGradients(llm, llm.emb)
      llm_attr = LLMGradientAttribution(attr, tokenizer)
  
      inp = TextTokenInput("a b c", tokenizer)
      res = llm_attr.attribute(inp, "m n o p q")
  
      # 5 output tokens, 4 input tokens including sos
      self.assertEqual(res.seq_attr.shape, (4,))
      self.assertEqual(res.token_attr.shape, (5, 4))
      self.assertEqual(res.input_tokens, ["<sos>", "a", "b", "c"])
      self.assertEqual(res.output_tokens, ["m", "n", "o", "p", "q"])
  
      self.assertEqual(res.seq_attr.device.type, self.device)
      self.assertEqual(res.token_attr.device.type, self.device)
  
imports: import copy
  from collections import namedtuple
  from typing import cast, List, Optional, Union
  import torch
  from captum.attr._core.feature_ablation import FeatureAblation
  from captum.attr._core.kernel_shap import KernelShap
  from captum.attr._core.layer.layer_integrated_gradients import LayerIntegratedGradients
  from captum.attr._core.lime import Lime
  from captum.attr._core.llm_attr import LLMAttribution, LLMGradientAttribution
  from captum.attr._core.shapley_value import ShapleyValueSampling
  from captum.attr._utils.interpretable_input import TextTemplateInput, TextTokenInput
  from parameterized import parameterized, parameterized_class
  from tests.helpers.basic import assertTensorAlmostEqual, BaseTest
  from torch import nn, Tensor
label_desc: Use image node_id 1 for calling the TestLLMGradAttr obj's underlying member method code with example usage: obj.test_llm_attr() without return types