class_docstr: Still under development.
class_docstr_tok: ["Still","under","development","."]
code: def summarize(self, X, sample_weight=None):
      if self.frozen == True:
          return
  
      X = _check_parameter(
          _cast_as_tensor(X),
          "X",
          ndim=3,
          dtypes=(torch.int32, torch.int64),
          check_parameter=self.check_data,
      )
  
      if not self._initialized:
          self._initialize(len(X[0][0]), torch.max(X, dim=0)[0].T + 1)
  
      X = _check_parameter(
          X,
          "X",
          shape=(-1, self.n_parents, self.d),
          check_parameter=self.check_data,
      )
      sample_weight = _check_parameter(
          _cast_as_tensor(sample_weight, dtype=torch.float32),
          "sample_weight",
          min_value=0,
          ndim=(1, 2),
      )
  
      if sample_weight is None:
          sample_weight = torch.ones(
              X[:, 0].shape[0],
              X[:, 0].shape[-1],
              dtype=self.probs[0].dtype,
          )
      elif len(sample_weight.shape) == 1:
          sample_weight = sample_weight.reshape(-1, 1).expand(
              -1, X.shape[2]
          )
      elif sample_weight.shape[1] == 1 and self.d > 1:
          sample_weight = sample_weight.expand(-1, X.shape[2])
  
      _check_parameter(
          sample_weight,
          "sample_weight",
          min_value=0,
          ndim=2,
          shape=(X.shape[0], X.shape[2]),
      )
  
      for j in range(self.d):
          strides = torch.tensor(
              self._xw_sum[j].stride(), device=X.device
          )
          X_ = torch.sum(X[:, :, j] * strides, dim=-1)
  
          self._xw_sum[j].view(-1).scatter_add_(
              0, X_, sample_weight[:, j]
          )
          self._w_sum[j][:] = self._xw_sum[j].sum(dim=-1)
  
file_path: pomegranate/pomegranate/distributions/conditional_categorical.py
imports: import numpy
  import torch
  import itertools
  from .._utils import _cast_as_tensor
  from .._utils import _cast_as_parameter
  from .._utils import _update_parameter
  from .._utils import _check_parameter
  from .._utils import _reshape_weights
  from .._utils import BufferList
  from ._distribution import ConditionalDistribution
  from .categorical import Categorical
label_desc: Use image node_id 6 for calling the ConditionalCategorical obj's underlying member method code with example usage: obj.summarize(X, sample_weight) without return types