docstr: This test verifies that api usage logging is not triggered via static
  initialization. Since it's triggered at first invocation only - we just
  subprocess
docstr_tok: ["This","test","verifies","that","api","usage","logging","is","not","triggered","via","static","initialization",".","Since","it","'s","triggered","at","first","invocation","only","-","we","just","subprocess"]
code: def testApiUsage(self):
      """
      This test verifies that api usage logging is not triggered via static
      initialization. Since it's triggered at first invocation only - we just
      subprocess
      """
      s = TestCase.runWithPytorchAPIUsageStderr("import torch")
      self.assertRegex(s, "PYTORCH_API_USAGE.*import")
      # import the shared library directly - it triggers static init but doesn't call anything
      s = TestCase.runWithPytorchAPIUsageStderr(
          f"from ctypes import CDLL; CDLL('{torch._C.__file__}')"
      )
      self.assertNotRegex(s, "PYTORCH_API_USAGE")
  
imports: import torch
  from torch.testing._internal.common_utils import TestCase, run_tests
label_desc: Use image node_id 1 for calling the LoggingTest obj's underlying member method code with example usage: obj.testApiUsage() without return types