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

Function init_tensor_data

internal/tests/executor/tests/test_scale.cpp:40–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38
39using namespace TEngine;
40void init_tensor_data(float* addr, int number, int fixed_val)
41{
42 srand(1987);
43
44 for(int i = 0; i < number; i++)
45 {
46#if 1
47 if(fixed_val)
48 addr[i] = random() / 1000000;
49 else
50 addr[i] = 0;
51#else
52 if(fixed_val >= 0)
53 addr[i] = fixed_val;
54 else if(fixed_val == -2)
55 {
56 addr[i] = random() / 1000000;
57 // addr[i]=1;
58 }
59 else if(fixed_val == -3)
60 {
61 addr[i] = random() / 1000000;
62 // addr[i]=2;
63 }
64 else
65 addr[i] = i;
66#endif
67 }
68}
69float op_fops;
70
71Node* create_scale_node(int n, int c, int h, int w)

Callers 1

create_scale_nodeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected