Run black autoformatter

This commit is contained in:
2024-05-30 13:18:51 +02:00
parent 2f3c34b8b5
commit fcd7d96126
7 changed files with 110 additions and 85 deletions

View File

@@ -1,8 +1,10 @@
import torch
from utils import print_cpp_vector
def gen_dense_softmax_test():
# fmt: off
input = torch.tensor([
0.1, 0.2, 0.3, 0.4, 0.5
])
@@ -17,6 +19,7 @@ def gen_dense_softmax_test():
biases = torch.tensor([
0.1, 0.2, 0.3, 0.4
])
# fmt: on
dense = torch.nn.Linear(5, 4)
dense.weight = torch.nn.Parameter(weights)
@@ -35,10 +38,9 @@ def gen_dense_softmax_test():
souftmax_out = softmax_exp / softmax_sum
print(souftmax_out)
softmax = torch.nn.Softmax(dim=0)(output)
print_cpp_vector(softmax)
if __name__ == "__main__":
gen_dense_softmax_test()
gen_dense_softmax_test()