Caffe2 - C++ API
A deep learning, cross platform ML framework
assert_op.cc
1 
16 #include "caffe2/operators/assert_op.h"
17 
18 namespace caffe2 {
19 
20 REGISTER_CPU_OPERATOR(Assert, AssertOp<CPUContext>);
21 
22 OPERATOR_SCHEMA(Assert)
23  .NumInputs(1)
24  .NumOutputs(0)
25  .SetDoc(R"DOC(
26 Assertion op. Takes in a tensor of bools, ints, longs, or long longs and checks
27 if all values are true when coerced into a boolean. In other words, for non-bool
28 types this asserts that all values in the tensor are non-zero.
29  )DOC")
30  .Arg(
31  "error_msg",
32  "An error message to print when the assert fails.",
33  false);
34 
35 } // namespace caffe2
Copyright (c) 2016-present, Facebook, Inc.