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

Function CopySliceToElement

tensorflow/core/util/batch_util.cc:162–181  ·  view source on GitHub ↗

Copies the index^th slice of parent (in the 0th dimension) into element.

Source from the content-addressed store, hash-verified

160
161// Copies the index^th slice of parent (in the 0th dimension) into element.
162Status CopySliceToElement(const Tensor& parent, Tensor* element, int64 index) {
163 TF_RETURN_IF_ERROR(ValidateInput(parent, *element, index));
164
165#define HANDLE_TYPE(T) \
166 case DataTypeToEnum<T>::value: { \
167 HandleSliceToElement<T>(parent, element, index); \
168 return Status::OK(); \
169 }
170
171 switch (parent.dtype()) {
172 TF_CALL_ALL_TYPES(HANDLE_TYPE);
173 TF_CALL_QUANTIZED_TYPES(HANDLE_TYPE);
174 TF_CALL_uint32(HANDLE_TYPE);
175 TF_CALL_uint64(HANDLE_TYPE);
176#undef HANDLE_TYPE
177 default:
178 return errors::Unimplemented("CopySliceToElement Unhandled data type: ",
179 element->dtype());
180 }
181}
182
183// Copies the index^th slice of parent (in the 0th dimension) into element.
184//

Callers 5

CopySliceToElementMethod · 0.85
GetNextInternalMethod · 0.85

Calls 3

UnimplementedFunction · 0.85
ValidateInputFunction · 0.70
dtypeMethod · 0.45

Tested by

no test coverage detected