":shape_inference_testutil",
":tensor_testutil",
":test",
+ ":testlib_ops",
"//tensorflow/cc:scope",
"//tensorflow/core/kernels:constant_op",
"//tensorflow/core/kernels:ops_testutil",
],
)
+cc_library(
+ name = "testlib_ops",
+ testonly = 1,
+ srcs = ["common_runtime/testlib_ops.cc"],
+ linkstatic = 1, # Seems to be needed since alwayslink is broken in bazel
+ deps = [
+ "//tensorflow/core:framework",
+ "//tensorflow/core:lib",
+ ],
+ alwayslink = 1,
+)
+
# This is a link-only library to provide a DirectSession
# implementation of the Session interface.
tf_cuda_library(
)
tf_cc_test(
+ name = "common_runtime_executor_test",
+ size = "small",
+ srcs = ["common_runtime/executor_test.cc"],
+ linkstatic = tf_kernel_tests_linkstatic(),
+ deps = [
+ ":core",
+ ":core_cpu",
+ ":core_cpu_internal",
+ ":framework",
+ ":framework_internal",
+ ":lib",
+ ":lib_internal",
+ ":protos_all_cc",
+ ":test",
+ ":test_main",
+ ":testlib",
+ "//tensorflow/core/kernels:array",
+ "//tensorflow/core/kernels:control_flow_ops",
+ "//tensorflow/core/kernels:math",
+ "//tensorflow/core/kernels:random_ops",
+ "//tensorflow/core/kernels:state",
+ ],
+)
+
+tf_cc_test(
name = "common_runtime_function_test",
size = "small",
srcs = ["common_runtime/function_test.cc"],
limitations under the License.
==============================================================================*/
+#include "tensorflow/core/framework/common_shape_fns.h"
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/platform/macros.h"
namespace test {
// ErrorOp::Compute returns an error.
-REGISTER_OP("Error").Input("in: T").Output("out: T").Attr("T: type").Attr(
- "message: string");
+REGISTER_OP("Error")
+ .Input("in: T")
+ .Output("out: T")
+ .Attr("T: type")
+ .Attr("message: string")
+ .SetShapeFn(shape_inference::UnknownShape);
class ErrorOp : public OpKernel {
public:
explicit ErrorOp(OpKernelConstruction* ctx) : OpKernel(ctx) {
REGISTER_OP("InvalidRefType")
.Output("out: Ref(TIn)")
.Attr("TIn: type")
- .Attr("TOut: type");
+ .Attr("TOut: type")
+ .SetShapeFn(shape_inference::UnknownShape);
class InvalidRefType : public OpKernel {
public:
explicit InvalidRefType(OpKernelConstruction* ctx) : OpKernel(ctx) {
// DelayOp::AsyncCompute sleeps for "micros"-econd and then returns
// its input.
-REGISTER_OP("Delay").Input("in: T").Output("out: T").Attr("T: type").Attr(
- "micros: int");
+REGISTER_OP("Delay")
+ .Input("in: T")
+ .Output("out: T")
+ .Attr("T: type")
+ .Attr("micros: int")
+ .SetShapeFn(shape_inference::UnchangedShape);
class DelayOp : public AsyncOpKernel {
public:
explicit DelayOp(OpKernelConstruction* ctx) : AsyncOpKernel(ctx) {
],
)
-# TODO(mrry): Move executor_test.cc to ../common_runtime when once it no longer depends
-# on grpc_testlib.
-tf_cuda_cc_tests(
- name = "executor_tests",
+tf_cuda_cc_test(
+ name = "master_test",
size = "medium",
srcs = [
- "executor_test.cc",
- #"master_test.cc", # TODO(b/27683709): Re-enable when not flaky.
+ "master_test.cc",
],
linkstatic = tf_kernel_tests_linkstatic(),
- tags = tf_cuda_tests_tags(),
+ tags = tf_cuda_tests_tags() + [
+ "manual", # TODO(b/27683709): Re-enable when not flaky.
+ "notap", # TODO(b/27683709): Re-enable when not flaky.
+ "noguitar", # TODO(b/27683709): Re-enable when not flaky.
+ "nooss", # TODO(b/27683709): Re-enable when not flaky.
+ ],
deps = [
":master",
":remote_device",
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
"//tensorflow/core/distributed_runtime/rpc:grpc_channel",
+ "//tensorflow/core/distributed_runtime/rpc:grpc_master_service_impl",
"//tensorflow/core/distributed_runtime/rpc:grpc_testlib",
"//tensorflow/core/distributed_runtime/rpc:grpc_util",
"//tensorflow/core/distributed_runtime/rpc:grpc_worker_cache",
"//tensorflow/core:tensorflow",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
+ "//tensorflow/core:testlib",
"//tensorflow/core/distributed_runtime:server_lib",
"//tensorflow/core/distributed_runtime/rpc:grpc_server_lib",
"//tensorflow/core/distributed_runtime/rpc:grpc_session",
- "//tensorflow/core/distributed_runtime/rpc:grpc_testlib_ops",
"//tensorflow/core/kernels:aggregate_ops",
"//tensorflow/core/kernels:array",
],
#include "grpc++/grpc++.h"
#include "tensorflow/core/distributed_runtime/rpc/grpc_channel.h"
+#include "tensorflow/core/distributed_runtime/rpc/grpc_master_service_impl.h"
#include "tensorflow/core/distributed_runtime/rpc/grpc_testlib.h"
#include "tensorflow/core/distributed_runtime/rpc/grpc_util.h"
#include "tensorflow/core/framework/allocator.h"
#include "tensorflow/core/platform/test.h"
#include "tensorflow/core/platform/types.h"
#include "tensorflow/core/protobuf/master.pb.h"
-#include "tensorflow/core/protobuf/master_service.grpc.pb.h"
namespace tensorflow {
],
)
-tf_cuda_library(
- name = "grpc_testlib_ops",
- testonly = 1,
- srcs = ["grpc_testlib_ops.cc"],
- linkstatic = 1, # Seems to be needed since alwayslink is broken in bazel
- deps = [
- "//tensorflow/core:framework",
- "//tensorflow/core:lib",
- ],
- alwayslink = 1,
-)
-
tf_cc_binary(
name = "grpc_testlib_server",
testonly = 1,
],
deps = [
":grpc_server_lib",
- ":grpc_testlib_ops",
"//tensorflow/core:core_cpu",
"//tensorflow/core:framework_internal",
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
+ "//tensorflow/core:testlib",
"//tensorflow/core/distributed_runtime:server_lib",
"//tensorflow/core/kernels:constant_op",
"//tensorflow/core/kernels:cwise_op",
visibility = ["//tensorflow:__subpackages__"],
deps = [
":grpc_session",
- ":grpc_testlib_ops",
"//tensorflow/core:core_cpu",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:test",
+ "//tensorflow/core:testlib",
],
alwayslink = 1,
)