improve cpu.h header
This commit is contained in:
parent
5c369c6e26
commit
3174cf9af5
2 changed files with 9 additions and 2 deletions
|
|
@ -1,5 +1,12 @@
|
|||
#ifndef CPU_H
|
||||
#define CPU_H
|
||||
|
||||
#include "tensor.h"
|
||||
|
||||
void add_tensor_cpu(Tensor* tensor1, Tensor* tensor2, float* result_data);
|
||||
void sub_tensor_cpu(Tensor* tensor1, Tensor* tensor2, float* result_data);
|
||||
void elementwise_mul_tensor_cpu(Tensor* tensor1, Tensor* tensor2, float* result_data);
|
||||
void matmul_tensor_cpu(Tensor* tensor1, Tensor* tensor2, float* result_data);
|
||||
void pow_tensor_cpu(Tensor* tensor, float power, float* result_data);
|
||||
void pow_tensor_cpu(Tensor* tensor, float power, float* result_data);
|
||||
|
||||
#endif /* CPU_H */
|
||||
|
|
|
|||
2
test.py
2
test.py
|
|
@ -16,7 +16,7 @@ def matrix_sum(matrix1, matrix2):
|
|||
|
||||
if __name__ == "__main__":
|
||||
import norch
|
||||
a = norch.Tensor([[1, 2, 3], [1, 2, 3], [1, 2, 3]])
|
||||
a = norch.Tensor([[1, 2, 3], [1, 2, 3], [1, 2, 3]]).to("cuda")
|
||||
b = norch.Tensor([[1, 2, 3], [1, 2, 3], [1, 2, 3]])
|
||||
import time
|
||||
import random
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue