class_docstr: One shot hardware-aware estimator.
  
  Use model directly to get estimations with some hardware-aware metrics.
  
  Parameters
  ----------
  loss_f : str
      The name of loss funciton in PyTorch
  evaluation : list of Evaluation
      The evaluation metrics in module/train/evaluation
  hardware_evaluation : str or runable
      The hardware-aware metrics. Can be 'parameter' or 'latency'. Or you can define a special metric by a runable function
  hardware_metric_weight : float
      The weight of hardware-aware metric, which will be a bias added to metrics
class_docstr_tok: ["One","shot","hardware-aware","estimator",".","Use","model","directly","to","get","estimations","with","some","hardware-aware","metrics",".","Parameters","--","--","--","--","--","loss_f",":","str","The","name","of","loss","funciton","in","PyTorch","evaluation",":","list","of","Evaluation","The","evaluation","metrics","in","module\/train\/evaluation","hardware_evaluation",":","str","or","runable","The","hardware-aware","metrics",".","Can","be","'parameter","'","or","'latency","'",".","Or","you","can","define","a","special","metric","by","a","runable","function","hardware_metric_weight",":","float","The","weight","of","hardware-aware","metric",",","which","will","be","a","bias","added","to","metrics"]
code: def infer(self, model: BaseSpace, dataset, mask="train"):
      metrics, loss = super().infer(model, dataset, mask)
      if isinstance(self.hardware_evaluation, str):
          hardware_metric = get_hardware_aware_metric(
              model, self.hardware_evaluation
          )
      else:
          hardware_metric = self.hardware_evaluation(model)
      metrics = [
          x - hardware_metric * self.hardware_metric_weight
          for x in metrics
      ]
      metrics.append(hardware_metric)
      return metrics, loss
  
imports: import torch
  from deeprobust.graph.global_attack import Random, DICE
  import numpy
  import scipy.sparse
  from tqdm import tqdm
  import time
  import torch.nn.functional
  from .None import register_nas_estimator
  from ..space import BaseSpace
  from .base import BaseEstimator
  from ..backend import *
  from ...train.evaluation import Acc
  from ..utils import get_hardware_aware_metric
label_desc: Use image node_id 2 for calling the OneShotEstimator_HardwareAware obj's underlying member method code with example usage: obj.infer(model, dataset, mask) and returns: metrics,  loss