class_docstr: A class that provides a way to access the submodules and parameters/buffers of a module.
  
  It provides caching mechanism to speed up submodule lookups.
  This is useful for functional programming to manipulate the module state.
class_docstr_tok: ["A","class","that","provides","a","way","to","access","the","submodules","and","parameters\/buffers","of","a","module",".","It","provides","caching","mechanism","to","speed","up","submodule","lookups",".","This","is","useful","for","functional","programming","to","manipulate","the","module","state","."]
docstr: Swap the attribute specified by the given path to value.
  
  For example, to swap the attribute mod.layer1.conv1.weight,
  use accessor.swap_tensor("layer1.conv1.weight", value)
docstr_tok: ["Swap","the","attribute","specified","by","the","given","path","to","value",".","For","example",",","to","swap","the","attribute","mod.layer1.conv1.weight",",","use","accessor.swap_tensor","(","``","layer1.conv1.weight","''",",","value",")"]
code: def swap_tensor(
      self, name: str, value: torch.Tensor, allow_missing: bool = False
  ) -> torch.Tensor:
      """
      Swap the attribute specified by the given path to value.
  
      For example, to swap the attribute mod.layer1.conv1.weight,
      use accessor.swap_tensor("layer1.conv1.weight", value)
      """
      prefix, _, attr = name.rpartition(".")
      return swap_tensor(
          self.get_submodule(prefix),
          attr,
          value,
          allow_missing=allow_missing,
      )
  
imports: from typing import Dict, Iterable, List, Tuple
  import torch
label_desc: Use image node_id 7 for calling the NamedMemberAccessor obj's underlying member method code with example usage: obj.swap_tensor(name, value, allow_missing) and returns: swap_tensor