class_docstr: Helps decide whether to allow the kernel to contain diagonal entries only.
  
  The intended behavior is to be diagonal-only iff
    a) output off-diagonal entries are all zeros, and
  
    b) diagonal-only :class:`~neural_tangents.Kernel` is sufficient for all
    steps of computation.
  
  Note that currently this parameter is shared between all parallel branches,
  even if this is excessive, and it is defined once for the whole network and
  does not change from layer to layer, even if it could be possible.
  
  Must be endowed with
    1) A commutative, associative, idempotent `AND` (`&`) operation,
    corresponding to combining requirements of two layers in parallel.
  
    2) An associative composition `>>` operation, corresponding to the
    requirement of a composition of two layers.
  
  Attributes:
    input:
      specifies whether inputs to given layer can contain only diagonal
      entries. :attr:`Bool.YES` means "yes"; :attr:`Bool.MAYBE` means iff
      off-diagonal entries are zero. :attr:`Bool.NO` means "no". When
      traversing the network tree from inputs to outputs (as well as parallel
      branches from left/right to right/left) can only decrease.
  
    output:
      specifies whether any outputs (starting from this layer to the output of
      the network) can contain only diagonal entries. :attr:`Bool.YES` means
      yes; :attr:`Bool.MAYBE` means "yes" after current layer, but may become
      "no" further in the network. :attr:`Bool.NO` means "no".
class_docstr_tok: ["Helps","decide","whether","to","allow","the","kernel","to","contain","diagonal","entries","only",".","The","intended","behavior","is","to","be","diagonal-only","iff","a",")","output","off-diagonal","entries","are","all","zeros",",","and","b",")","diagonal-only",":","class",":","`","~neural_tangents.Kernel","`","is","sufficient","for","all","steps","of","computation",".","Note","that","currently","this","parameter","is","shared","between","all","parallel","branches",",","even","if","this","is","excessive",",","and","it","is","defined","once","for","the","whole","network","and","does","not","change","from","layer","to","layer",",","even","if","it","could","be","possible",".","Must","be","endowed","with","1",")","A","commutative",",","associative",",","idempotent","`","AND","`","(","`","&","`",")","operation",",","corresponding","to","combining","requirements","of","two","layers","in","parallel",".","2",")","An","associative","composition","`",">",">","`","operation",",","corresponding","to","the","requirement","of","a","composition","of","two","layers",".","Attributes",":","input",":","specifies","whether","inputs","to","given","layer","can","contain","only","diagonal","entries",".",":","attr",":","`","Bool.YES","`","means","``","yes","''",";",":","attr",":","`","Bool.MAYBE","`","means","iff","off-diagonal","entries","are","zero",".",":","attr",":","`","Bool.NO","`","means","``","no","''",".","When","traversing","the","network","tree","from","inputs","to","outputs","(","as","well","as","parallel","branches","from","left\/right","to","right\/left",")","can","only","decrease",".","output",":","specifies","whether","any","outputs","(","starting","from","this","layer","to","the","output","of","the","network",")","can","contain","only","diagonal","entries",".",":","attr",":","`","Bool.YES","`","means","yes",";",":","attr",":","`","Bool.MAYBE","`","means","``","yes","''","after","current","layer",",","but","may","become","``","no","''","further","in","the","network",".",":","attr",":","`","Bool.NO","`","means","``","no","''","."]
docstr: Convert to `diagonal_spatial` / `diagonal_batch` `Kernel` attribute.
docstr_tok: ["Convert","to","`","diagonal_spatial","`","\/","`","diagonal_batch","`","`","Kernel","`","attribute","."]
code: def __bool__(self) -> bool:
      """Convert to `diagonal_spatial` / `diagonal_batch` `Kernel` attribute."""
      return self.input == Bool.YES and self.output > Bool.NO
  
imports: import dataclasses
  import enum
  from typing import Callable, Optional, Sequence, Union
  import warnings
  import frozendict
  import jax
  from jax import eval_shape
  from jax import lax
  from jax import numpy
  from jax.core import ShapedArray
  from jax.tree_util import tree_all
  from jax.tree_util import tree_map
  import numpy
  from ..utils import dataclasses
  from ..utils import utils
  from ..utils.kernel import Kernel
  from ..utils.typing import AnalyticKernelFn
  from ..utils.typing import ApplyFn
  from ..utils.typing import Axes
  from ..utils.typing import Get
  from ..utils.typing import InitFn
  from ..utils.typing import InternalLayer
  from ..utils.typing import Layer
  from ..utils.typing import LayerKernelFn
  from ..utils.typing import NTTree
  from ..utils.typing import PyTree
label_desc: Use image node_id 3 for calling the Diagonal obj's underlying member method code with example usage: obj.__bool__() and returns: unknown