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

Method SendShape

tensorflow/core/kernels/slice_sendrecv_ops.cc:108–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108Status SliceSendOp::SendShape(OpKernelContext* ctx,
109 const FrameAndIter& frame_iter,
110 const Tensor& input_t) {
111 Rendezvous::Args args;
112 args.device_context = ctx->op_device_context();
113 args.alloc_attrs = AllocatorAttributes();
114 Rendezvous::ParsedKey parsed_key;
115
116 Tensor shape_t;
117 TensorShape shape = input_t.shape();
118 const int rank = shape.dims();
119 TF_RETURN_IF_ERROR(ctx->allocate_temp(DT_INT64, TensorShape({rank}),
120 &shape_t));
121 auto shape_vec = shape_t.vec<int64>();
122 for (int i = 0; i < rank; i++) {
123 shape_vec(i) = shape.dim_size(i);
124 }
125 slice_sendrecv::GetSliceRendezvousKey(key_prefix_,
126 "_slice_transfer_shape", frame_iter, &parsed_key.buf_);
127 VLOG(2) << "SliceSend " << parsed_key.buf_;
128 TF_RETURN_IF_ERROR(Rendezvous::ParseKey(parsed_key.buf_, &parsed_key));
129 return ctx->rendezvous()->Send(parsed_key, args, shape_t,
130 ctx->is_input_dead());
131}
132
133Status SliceSendOp::SendString(OpKernelContext* ctx,
134 const FrameAndIter& frame_iter,

Callers

nothing calls this directly

Calls 11

AllocatorAttributesClass · 0.85
GetSliceRendezvousKeyFunction · 0.85
rendezvousMethod · 0.80
is_input_deadMethod · 0.80
TensorShapeClass · 0.50
op_device_contextMethod · 0.45
shapeMethod · 0.45
dimsMethod · 0.45
allocate_tempMethod · 0.45
dim_sizeMethod · 0.45
SendMethod · 0.45

Tested by

no test coverage detected