code: def __post_init__(self, validate_init: bool = True):
      if not validate_init:
          return
  
      if self.tril.shape[-2] != self.tril.shape[-1]:
          raise ValueError(
              f"Expected square matrices but `matrix` has shape `{self.tril.shape}`."
          )
  
      if self.perm.shape != self.tril.shape[:-1]:
          raise ValueError(
              f"`perm` of shape `{self.perm.shape}` incompatible with "
              f"`matrix` of shape `{self.tril.shape}`."
          )
  
      if (
          self.diag is not None
          and self.diag.shape != self.tril.shape[:-1]
      ):
          raise ValueError(
              f"`diag` of shape `{self.diag.shape}` incompatible with "
              f"`matrix` of shape `{self.tril.shape}`."
          )
  
file_path: botorch/botorch/utils/probability/linalg.py
imports: from __future__ import annotations
  from dataclasses import dataclass, InitVar
  from itertools import chain
  from typing import Any, Optional, Sequence
  import torch
  from botorch.utils.probability.utils import swap_along_dim_
  from linear_operator.utils.errors import NotPSDError
  from torch import LongTensor, Tensor
  from torch.nn.functional import pad
label_desc: Use image node_id 1 for calling the PivotedCholesky obj's underlying member method code with example usage: obj.__post_init__(validate_init) without return types