code: def replace_attr(obj, name: str, value):
      torch_attr = getattr(obj, name)
      setattr(obj, name, value)
  
imports: import torch
  from typing import Any, List, Optional, Union
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 3 for calling a global function with example usage: replace_attr(obj, name, value) without return types