class_docstr: A base class for all regularizers.
class_docstr_tok: ["A","base","class","for","all","regularizers","."]
docstr: Update the regularization term based on passed tensors.
docstr_tok: ["Update","the","regularization","term","based","on","passed","tensors","."]
code: def update(self, *tensors: torch.FloatTensor) -> None:
      """Update the regularization term based on passed tensors."""
      if (
          not self.training
          or not torch.is_grad_enabled()
          or (self.apply_only_once and self.updated)
      ):
          return
      self.regularization_term = self.regularization_term + sum(
          self.forward(x=x) for x in tensors
      )
      self.updated = True
  
imports: from __future__ import annotations
  import warnings
  from abc import ABC, abstractmethod
  from typing import Any, ClassVar, Iterable, Mapping, Optional
  import torch
  from class_resolver import ClassResolver, normalize_string
  from torch import nn
  from torch.nn import functional
  from .utils import lp_norm, powersum_norm
label_desc: Use image node_id 6 for calling the Regularizer obj's underlying member method code with example usage: obj.update() without return types