class_docstr: Wrap a value (int or dict with int keys), so that the computation on it can be replayed.
  It builds a binary tree. If ``value`` is not None, it's a leaf node.
  Otherwise, it has left sub-tree and right sub-tree and an operation.
  
  Only support basic arithmetic operations: ``+``, ``-``, ``*``, ``//``.
docstr: Iterate over values on leaf nodes.
docstr_tok: ["Iterate","over","values","on","leaf","nodes","."]
code: def leaf_values(self) -> Iterator[int_or_int_dict]:
      """Iterate over values on leaf nodes."""
      if self.value is not None:
          yield self.value
      else:
          if isinstance(self.lhs, MaybeWeighted):
              yield from self.lhs.leaf_values()
          if isinstance(self.rhs, MaybeWeighted):
              yield from self.rhs.leaf_values()
  
imports: from __future__ import annotations
  import operator
  from typing import Callable, Iterator, TypeVar, Any, Optional, Tuple, Union, List, Dict, Generic, cast
  import numpy
  import torch
label_desc: Use image node_id 2 for calling the MaybeWeighted obj's underlying member method code with example usage: obj.leaf_values() without return types