This repository was archived by the owner on Apr 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,7 @@ namespace caffe2 {
19
19
20
20
namespace detail {
21
21
22
- std::mutex& RNGMutex () {
23
- static std::mutex rng_mutex;
24
- return rng_mutex;
25
- }
22
+ std::mutex& RNGMutex ();
26
23
27
24
template <typename T>
28
25
T* NewTensor (
Original file line number Diff line number Diff line change 16
16
#include " test_harness.h"
17
17
18
18
namespace caffe2 {
19
+ namespace detail {
20
+
21
+ std::mutex& RNGMutex () {
22
+ static std::mutex rng_mutex;
23
+ return rng_mutex;
24
+ }
25
+
26
+ } // namespace detail
27
+
28
+ ReferenceImplementationBuilder MakeDefaultReferenceImplementationBuilder () {
29
+ return [](const OperatorDef& op_def, NetDef* net_def) {
30
+ caffe2::ReferenceImplementationRegistry::Append (net_def, op_def);
31
+ };
32
+ }
19
33
20
34
void CheckEqual (
21
35
const caffe2::Tensor<caffe2::CPUContext>& Texpected,
Original file line number Diff line number Diff line change @@ -87,11 +87,7 @@ at::Tensor MakeAtenTensor(
87
87
using ReferenceImplementationBuilder =
88
88
std::function<void (const OperatorDef& op_def, NetDef* net_def)>;
89
89
90
- ReferenceImplementationBuilder MakeDefaultReferenceImplementationBuilder () {
91
- return [](const OperatorDef& op_def, NetDef* net_def) {
92
- caffe2::ReferenceImplementationRegistry::Append (net_def, op_def);
93
- };
94
- }
90
+ ReferenceImplementationBuilder MakeDefaultReferenceImplementationBuilder ();
95
91
96
92
// / Creates an OperatorDef for a particular Backend
97
93
// / op_name is the name of the operator (e.g. TcOp)
You can’t perform that action at this time.
0 commit comments