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

Function TensorIndexToFlat

tensorflow/core/kernels/conv_2d_gpu.h:154–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152// A helper function that converts a tensor index into a flat array index.
153template <int IndexCount>
154EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int TensorIndexToFlat(
155 const Index<IndexCount>& index, const Dimension<IndexCount>& dims) {
156 int flat_index = index[0];
157 for (int i = 1; i < IndexCount; i++) {
158 flat_index = flat_index * dims[i] + index[i];
159 }
160 return flat_index;
161}
162
163// A helper function that converts a flat array index into a tensor index.
164template <int IndexCount>

Callers 3

GPU_1D_KERNEL_LOOPFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected