class_docstr: Filter the sample based on the result of the profiler.
  
  Subclass should implement the ``filter`` method that returns true or false
  to indicate whether the sample is valid.
  
  Directly call the instance of this class will call the ``filter`` method.
class_docstr_tok: ["Filter","the","sample","based","on","the","result","of","the","profiler",".","Subclass","should","implement","the","``","filter","``","method","that","returns","true","or","false","to","indicate","whether","the","sample","is","valid",".","Directly","call","the","instance","of","this","class","will","call","the","``","filter","``","method","."]
code: def filter(self, sample: Sample) -> bool:
      raise NotImplementedError()
  
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 2 for calling the ProfilerFilter obj's underlying member method code with example usage: obj.filter(sample) without return types