aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/client/test_construction_fails_op.cc
blob: 47b2b5b49c59dd3820926e0dd2becd1dbbe7d0e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/public/status.h"

namespace tensorflow {

REGISTER_OP("ConstructionFails");

class ConstructionFailsOp : public OpKernel {
 public:
  explicit ConstructionFailsOp(OpKernelConstruction* ctx) : OpKernel(ctx) {
    OP_REQUIRES(ctx, false,
                errors::InvalidArgument("Failure during construction."));
  }

  void Compute(OpKernelContext* ctx) override {}
};

REGISTER_KERNEL_BUILDER(Name("ConstructionFails").Device(DEVICE_CPU),
                        ConstructionFailsOp);

}  // end namespace tensorflow