class_docstr: Base class to calculate hidden state loss.
  Returned dict includes a loss value and additional outputs.
class_docstr_tok: ["Base","class","to","calculate","hidden","state","loss",".","Returned","dict","includes","a","loss","value","and","additional","outputs","."]
docstr: Validate inputs
docstr_tok: ["Validate","inputs"]
code: def _validate_inputs(self, inputs):
      """Validate inputs"""
      # validate inputs
      if not set(self.input_names).issubset(set(inputs.keys())):
          raise ValueError(
              f"Inputs should contain {self.input_names}, but got {inputs.keys()}"
          )
  
imports: import math
  import torch
label_desc: Use image node_id 3 for calling the MegatronBaseHiddenLoss obj's underlying member method code with example usage: obj._validate_inputs(inputs) without return types