class_docstr: Computes a fixed-size sample per slice.
docstr: Initializes a FixedSizeSample metric.
  
  Args:
    sampled_key: The key whose values should be sampled
    size: The number of samples to collect (per slice)
    name: Metric name.
    random_seed: The random_seed to be used for intializing the per worker
      np.random.RandomGenerator in the CombineFn setup. Note that when more
      than one worker is used, setting this is not sufficient to guarantee
      determinism.
docstr_tok: ["Initializes","a","FixedSizeSample","metric",".","Args",":","sampled_key",":","The","key","whose","values","should","be","sampled","size",":","The","number","of","samples","to","collect","(","per","slice",")","name",":","Metric","name",".","random_seed",":","The","random_seed","to","be","used","for","intializing","the","per","worker","np.random.RandomGenerator","in","the","CombineFn","setup",".","Note","that","when","more","than","one","worker","is","used",",","setting","this","is","not","sufficient","to","guarantee","determinism","."]
code: def __init__(
      self,
      sampled_key: Text,
      size: int,
      name: Text = FIXED_SIZE_SAMPLE_NAME,
      random_seed: Optional[int] = None,
  ):
      """Initializes a FixedSizeSample metric.
  
      Args:
        sampled_key: The key whose values should be sampled
        size: The number of samples to collect (per slice)
        name: Metric name.
        random_seed: The random_seed to be used for intializing the per worker
          np.random.RandomGenerator in the CombineFn setup. Note that when more
          than one worker is used, setting this is not sufficient to guarantee
          determinism.
      """
      super().__init__(
          _fixed_size_sample,
          sampled_key=sampled_key,
          size=size,
          name=name,
          random_seed=random_seed,
      )
  
file_path: model-analysis/tensorflow_model_analysis/metrics/sample_metrics.py
imports: from typing import Any, List, Optional, Text, Tuple
  import apache_beam
  import numpy
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.utils import beam_util
  from tensorflow_model_analysis.utils import util
label_desc: Use image node_id 1 to create a new FixedSizeSample object from inherited base classes: metric_types with example: obj = FixedSizeSample(sampled_key, size, name, random_seed)