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

Function IsFullSlice

tensorflow/core/util/tensor_bundle/tensor_bundle.cc:345–354  ·  view source on GitHub ↗

Returns whether "slice_spec" is a full slice, with respect to the full shape. This can happen say, when "slice_spec" is "TensorSlice(full_tensor_shape.dims())", or when it is "TensorSlice({{0, dim(0)}, ..., {0, dim(N)}})" -- a degenerate case we need to guard against.

Source from the content-addressed store, hash-verified

343// "TensorSlice(full_tensor_shape.dims())", or when it is "TensorSlice({{0,
344// dim(0)}, ..., {0, dim(N)}})" -- a degenerate case we need to guard against.
345bool IsFullSlice(const TensorSlice& slice_spec,
346 const TensorShape& full_tensor_shape) {
347 if (slice_spec.IsFull()) {
348 return true;
349 } else {
350 TensorShape sliced_shape;
351 slice_spec.SliceTensorShape(full_tensor_shape, &sliced_shape).IgnoreError();
352 return sliced_shape == full_tensor_shape;
353 }
354}
355
356Status CorruptFileError(const Status& in_status, const string& filename,
357 const string& detail) {

Callers 2

AddSliceMethod · 0.85
GetSliceValueMethod · 0.85

Calls 3

SliceTensorShapeMethod · 0.80
IsFullMethod · 0.45
IgnoreErrorMethod · 0.45

Tested by

no test coverage detected