MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / SetOutputs

Function SetOutputs

tensorflow/core/kernels/functional_ops.cc:99–114  ·  view source on GitHub ↗

Sets "rets" to be the output of "ctx". Validates rets' types based on "kernel".

Source from the content-addressed store, hash-verified

97// Sets "rets" to be the output of "ctx". Validates rets' types based
98// on "kernel".
99Status SetOutputs(const OpKernel* kernel, OpKernelContext* ctx,
100 gtl::ArraySlice<Tensor> rets) {
101 if (rets.size() != ctx->num_outputs()) {
102 return errors::Internal("Expect to produce ", ctx->num_outputs(),
103 " tensors, but only get ", rets.size());
104 }
105 for (int i = 0; i < rets.size(); ++i) {
106 if (rets[i].dtype() != kernel->output_type(i)) {
107 return errors::Internal("Expect ", i, "-th output is of type ",
108 DataTypeString(kernel->output_type(i)),
109 " but get ", DataTypeString(rets[i].dtype()));
110 }
111 ctx->set_output(i, rets[i]);
112 }
113 return Status::OK();
114}
115
116void SetRunOptions(OpKernelContext* ctx, FunctionLibraryRuntime::Options* opts,
117 bool always_collect_stats) {

Callers 4

StartMethod · 0.85
StartMethod · 0.85
FinishMethod · 0.85
FinishMethod · 0.85

Calls 7

InternalFunction · 0.85
DataTypeStringFunction · 0.50
sizeMethod · 0.45
num_outputsMethod · 0.45
dtypeMethod · 0.45
output_typeMethod · 0.45
set_outputMethod · 0.45

Tested by

no test coverage detected