docs: def _build_tpm(tpm):
          """Validate the TPM passed by the user and convert to multidimensional
          form.
          """
          tpm = np.array(tpm)
  
          validate.tpm(tpm)
  
          # Convert to multidimensional state-by-node form
          if is_state_by_state(tpm):
              tpm = convert.state_by_state2state_by_node(tpm)
          else:
              tpm = convert.to_multidimensional(tpm)
  
          utils.np_immutable(tpm)
  
          return (tpm, utils.np_hash(tpm))