MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / Relu

Function Relu

oneflow/api/cpp/tests/nn_test.cpp:29–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28template<typename T>
29std::vector<T> Relu(const std::vector<T>& data) {
30 std::vector<T> result(data.begin(), data.end());
31 T zero = static_cast<T>(0);
32 for (auto& x : result) {
33 if (x < zero) { x = zero; }
34 }
35 return result;
36}
37
38} // namespace
39

Callers 7

TestReluFunction · 0.70
operator()Method · 0.50
operator()Method · 0.50
operator()Method · 0.50
PyTensorObject_reluFunction · 0.50
PyTensorObject_relu_Function · 0.50
reluFunction · 0.50

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected