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

Function GetSliceShape

tensorflow/core/util/sparse/sparse_tensor.h:365–375  ·  view source on GitHub ↗

Helper for Split() that returns the shape given a slice index.

Source from the content-addressed store, hash-verified

363
364 // Helper for Split() that returns the shape given a slice index.
365 static inline int GetSliceShape(const int slice_index, const int split_size,
366 const int residual) {
367 DCHECK_GT(split_size, 0);
368 DCHECK_GE(slice_index, 0);
369 if (residual == 0) return split_size;
370 if (slice_index < residual) {
371 return split_size + 1;
372 } else {
373 return split_size;
374 }
375 }
376
377 Tensor ix_;
378 Tensor vals_;

Callers 1

SplitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected