MCPcopy Create free account
hub / github.com/OAID/Tengine / init_tensor_data

Function init_tensor_data

internal/tests/executor/tests/test_prelu.cpp:39–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38using namespace TEngine;
39void init_tensor_data(float* addr, int number, int fixed_val)
40{
41 for(int i = 0; i < number; i++)
42 {
43 if(fixed_val >= 0)
44 addr[i] = fixed_val;
45 else if(fixed_val == -2)
46 {
47 addr[i] = 1;
48 }
49 else if(fixed_val == -3)
50 {
51 addr[i] = 2;
52 }
53 else
54 {
55 if(i % 3 == 0)
56 addr[i] = -i;
57 else
58 {
59 addr[i] = i % 5;
60 }
61 }
62 }
63}
64float op_fops;
65
66Node* create_prelu_node(int n, int c, int h, int w)

Callers 1

create_prelu_nodeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected