code: def test_topk_quantized_scalar_input(self):
      # Calling topk on a quantized scalar input used to segfault,
      # see https://github.com/pytorch/pytorch/issues/116324
      x = torch.quantize_per_tensor(
          torch.randn(()), 0.1, 10, torch.qint8
      )
      x.topk(1)
  
imports: import torch
  import numpy
  import random
  from torch import nan
  from itertools import permutations, product
  from torch.testing import make_tensor
  from torch.testing._internal.common_dtype import all_types, all_types_and, floating_types_and, integral_types
  from torch.testing._internal.common_utils import TestCase, run_tests, slowTest, skipIfTorchDynamo
  from torch.testing._internal.common_device_type import instantiate_device_type_tests, dtypes, onlyNativeDeviceTypes, onlyCUDA, dtypesIfCUDA, dtypesIfCPU, onlyCPU, largeTensorTest
label_desc: Use image node_id 18 for calling the TestSortAndSelect obj's underlying member method code with example usage: obj.test_topk_quantized_scalar_input() without return types