Kernels
kernel
File size: 320 Bytes
5bb63f9
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <torch/library.h>

#include "registration.h"
#include "torch_binding.h"

TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) {
  ops.def("top_k(Tensor logits, int k, bool softmax) -> Tensor[]");

#if defined(METAL_KERNEL)
  ops.impl("top_k", torch::kMPS, &top_k);
#endif
}

REGISTER_EXTENSION(TORCH_EXTENSION_NAME)