Download fairseq/modules/dynamicconv_layer/dynamicconv_cuda.cpp from gradio/HuBERT: direct link, hf CLI and curl.
- Browser
- Download file 1.48 kB
-
https://huggingface.co/spaces/gradio/HuBERT/resolve/main/fairseq/modules/dynamicconv_layer/dynamicconv_cuda.cpp
- Command line
-
hf download hf://spaces/gradio/HuBERT/fairseq/modules/dynamicconv_layer/dynamicconv_cuda.cpp
-
curl -L -o dynamicconv_cuda.cpp https://huggingface.co/spaces/gradio/HuBERT/resolve/main/fairseq/modules/dynamicconv_layer/dynamicconv_cuda.cpp
1.48 kB
| /** | |
| * Copyright (c) Facebook, Inc. and its affiliates. | |
| * | |
| * This source code is licensed under the MIT license found in the | |
| * LICENSE file in the root directory of this source tree. | |
| */ | |
| std::vector<at::Tensor> dynamicconv_cuda_forward( | |
| at::Tensor input, | |
| at::Tensor filters, | |
| int padding_l); | |
| std::vector<at::Tensor> dynamicconv_cuda_backward( | |
| at::Tensor gradOutput, | |
| int padding_l, | |
| at::Tensor input, | |
| at::Tensor filters); | |
| std::vector<at::Tensor> dynamicconv_forward( | |
| at::Tensor input, | |
| at::Tensor filters, | |
| int padding_l) { | |
| CHECK_INPUT(input); | |
| CHECK_INPUT(filters); | |
| return dynamicconv_cuda_forward(input, filters, | |
| padding_l); | |
| } | |
| std::vector<at::Tensor> dynamicconv_backward( | |
| at::Tensor gradOutput, | |
| int padding_l, | |
| at::Tensor input, | |
| at::Tensor filters) { | |
| CHECK_INPUT(gradOutput); | |
| CHECK_INPUT(input); | |
| CHECK_INPUT(filters); | |
| return dynamicconv_cuda_backward(gradOutput, padding_l, | |
| input, filters); | |
| } | |
| PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { | |
| m.def("forward", &dynamicconv_forward, "dynamicconv forward (CUDA)"); | |
| m.def("backward", &dynamicconv_backward, "dynamicconv backward (CUDA)"); | |
| } | |