Initial commit
This commit is contained in:
20
workloads.py
Normal file
20
workloads.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import torch
|
||||
|
||||
def gemv(matrix, input_vector):
|
||||
return torch.matmul(matrix, input_vector)
|
||||
|
||||
def gemv_layers(matrix, input_vector):
|
||||
for _ in range(5):
|
||||
input_vector = torch.matmul(matrix, input_vector)
|
||||
input_vector.relu()
|
||||
|
||||
return input_vector
|
||||
|
||||
def vadd(vector_a, vector_b):
|
||||
return torch.add(vector_a, vector_b)
|
||||
|
||||
def vmul(vector_a, vector_b):
|
||||
return torch.mul(vector_a, vector_b)
|
||||
|
||||
def haxpy(vector_a, vector_b):
|
||||
return torch.add(vector_a, vector_b, alpha=2)
|
||||
Reference in New Issue
Block a user