Implement test multiple inference

This commit is contained in:
2024-04-14 00:19:29 +02:00
parent b20ade27d8
commit 13b455e4ba
2 changed files with 152 additions and 60 deletions

View File

@@ -84,5 +84,40 @@ if __name__ == "__main__":
# input = torch.rand(2, 6, 6)
print("Single test output:")
out = model(input)
utils.print_cpp_vector(out)
print("Multiple predict test output 1:")
input = torch.tensor([
0.81247, 0.03579, 0.26577, 0.80374, 0.64584, 0.19658, 0.04817,
0.50769, 0.33502, 0.01739, 0.32263, 0.69625, 0.07433, 0.98283,
0.21217, 0.48437, 0.58012, 0.86991, 0.81879, 0.63589, 0.30264,
0.90318, 0.12978, 0.35972, 0.95847, 0.58633, 0.55025, 0.68302,
0.61422, 0.79524, 0.7205, 0.72481, 0.51553, 0.83032, 0.23561,
0.80631, 0.23548, 0.84634, 0.05839, 0.76526, 0.39654, 0.95635,
0.75422, 0.75341, 0.82431, 0.79371, 0.72413, 0.88557, 0.33594,
0.56363, 0.12415, 0.05635, 0.15952, 0.27887, 0.05417, 0.58474,
0.75129, 0.1788, 0.88958, 0.49793, 0.85386, 0.86262, 0.05568,
0.16811, 0.72188, 0.08683, 0.66985, 0.62707, 0.4035, 0.51822,
0.46545, 0.88722
]).reshape(2, 6, 6)
out = model(input)
utils.print_cpp_vector(out)
print("Multiple predict test output 2:")
input = torch.tensor([
0.83573, 0.19191, 0.16004, 0.27137, 0.64768, 0.38417, 0.02167,
0.28834, 0.21401, 0.16624, 0.12037, 0.12706, 0.3588, 0.10685,
0.49224, 0.71267, 0.17677, 0.29276, 0.92467, 0.76689, 0.8209,
0.82226, 0.11581, 0.6698, 0.01109, 0.47085, 0.44912, 0.45936,
0.83645, 0.83272, 0.81693, 0.97726, 0.60649, 0.9, 0.37,
0.20517, 0.81921, 0.83573, 0.00271, 0.30453, 0.78925, 0.8453,
0.80416, 0.09041, 0.0802, 0.98408, 0.19746, 0.25598, 0.09437,
0.27681, 0.92053, 0.35385, 0.17389, 0.14293, 0.60151, 0.12338,
0.81858, 0.56294, 0.97378, 0.93272, 0.36075, 0.64944, 0.2433,
0.66075, 0.64496, 0.1191, 0.66261, 0.63431, 0.7137, 0.14851,
0.84456, 0.44482
]).reshape(2, 6, 6)
out = model(input)
utils.print_cpp_vector(out)