class_docstr: :class:`ProfilerPenalty` for a sample with distributions.
  Value for each label is a a mapping from chosen value to probablity.
class_docstr_tok: [":","class",":","`","ProfilerPenalty","`","for","a","sample","with","distributions",".","Value","for","each","label","is","a","a","mapping","from","chosen","value","to","probablity","."]
docstr: Profile based on a distribution of samples.
  
  Each value in the sample must be a dict representation a categorical distribution.
docstr_tok: ["Profile","based","on","a","distribution","of","samples",".","Each","value","in","the","sample","must","be","a","dict","representation","a","categorical","distribution","."]
code: def profile(self, sample: Sample) -> float:
      """Profile based on a distribution of samples.
  
      Each value in the sample must be a dict representation a categorical distribution.
      """
      if not isinstance(self.profiler, ExpressionProfiler):
          raise TypeError(
              "DifferentiableProfilerPenalty only supports ExpressionProfiler."
          )
      for key, value in sample.items():
          if not isinstance(value, dict):
              raise TypeError(
                  "Each value must be a dict representation a categorical distribution, "
                  f"but found {type(value)} for key {key}: {value}"
              )
      return expression_expectation(self.profiler.expression, sample)
  
imports: from __future__ import annotations
  import logging
  from typing import cast
  from typing_extensions import Literal
  import numpy
  import torch
  from torch import nn
  from nni.mutable import Sample
  from nni.nas.profiler import Profiler, ExpressionProfiler
  from .supermodule._expression_utils import expression_expectation
label_desc: Use image node_id 1 for calling the ExpectationProfilerPenalty obj's underlying member method code with example usage: obj.profile(sample) and returns: expression_expectation