Skip to content

Commit cf69061

Browse files
[skip ci] Auto-format code with clang-format and black
1 parent 1db4d98 commit cf69061

File tree

5 files changed

+11
-15
lines changed

5 files changed

+11
-15
lines changed

csrc/include/pmpp/types/torch_types.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ static_assert(sizeof(ScalarType) == 1);
1515
/**
1616
* @brief Combine DeviceT and ScalarT to a uint16_t.
1717
*/
18-
constexpr auto combineDeviceTandScalarT(DeviceType deviceT,
19-
ScalarType scalarT) -> uint16_t
18+
constexpr auto combineDeviceTandScalarT(DeviceType deviceT, ScalarType scalarT)
19+
-> uint16_t
2020
{
2121
return (uint16_t(deviceT) << 8) | uint16_t(scalarT);
2222
}

csrc/lib/ops/torch_impl.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
namespace pmpp::ops::cpu::torch_impl
66
{
7-
auto vectorAddImpl(const torch::Tensor& A,
8-
const torch::Tensor& B) -> torch::Tensor;
7+
auto vectorAddImpl(const torch::Tensor& A, const torch::Tensor& B)
8+
-> torch::Tensor;
99
auto cvtRGBtoGrayImpl(const torch::Tensor& img) -> torch::Tensor;
1010
} // namespace pmpp::ops::cpu::torch_impl
1111

1212
namespace pmpp::ops::cuda::torch_impl
1313
{
14-
auto vectorAddImpl(const torch::Tensor& A,
15-
const torch::Tensor& B) -> torch::Tensor;
14+
auto vectorAddImpl(const torch::Tensor& A, const torch::Tensor& B)
15+
-> torch::Tensor;
1616
auto cvtRGBtoGrayImpl(const torch::Tensor& img) -> torch::Tensor;
1717
} // namespace pmpp::ops::cuda::torch_impl

csrc/lib/ops/vecAdd/torch_impl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ extern void launchVecAdd(const fp32_t* a, const fp32_t* b, fp32_t* c,
2727

2828
namespace torch_impl
2929
{
30-
auto vectorAddImpl(const torch::Tensor& A,
31-
const torch::Tensor& B) -> torch::Tensor
30+
auto vectorAddImpl(const torch::Tensor& A, const torch::Tensor& B)
31+
-> torch::Tensor
3232
{
3333
VECTOR_ADD_CHECK(A, B, "CPU");
3434

@@ -57,8 +57,8 @@ extern void launchVecAdd(const fp32_t* d_A, const fp32_t* d_B, fp32_t* d_C,
5757

5858
namespace torch_impl
5959
{
60-
auto vectorAddImpl(const torch::Tensor& A,
61-
const torch::Tensor& B) -> torch::Tensor
60+
auto vectorAddImpl(const torch::Tensor& A, const torch::Tensor& B)
61+
-> torch::Tensor
6262
{
6363
VECTOR_ADD_CHECK(A, B, "CUDA");
6464

src/pmpp/models/attention.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,7 @@ def forward(self, prompt: torch.Tensor, is_prefilling: bool = True):
215215
# out: (seq_len, embed_dim)
216216
# k: (kv_len, embed_dim)
217217
# v: (kv_len, embed_dim)
218-
out, k, v = self.cached_mha(
219-
embedded_prompt, self.k_cache, self.v_cache
220-
)
218+
out, k, v = self.cached_mha(embedded_prompt, self.k_cache, self.v_cache)
221219

222220
# Update k cache and v cache
223221
# [NOTE]

test/test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@
1818
pic_in = pic_in.cuda()
1919
pic_out_cuda = torch.ops.pmpp.cvt_rgb_to_gray(pic_in)
2020
print(pic_out_cuda.cpu())
21-
22-

0 commit comments

Comments
 (0)