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

Function _FlatInnerDims

tensorflow/python/kernel_tests/scatter_nd_ops_test.py:48–52  ·  view source on GitHub ↗
(tensor, ndims=2)

Source from the content-addressed store, hash-verified

46
47
48def _FlatInnerDims(tensor, ndims=2):
49 shape = list(tensor.shape)
50 return tensor.reshape([
51 functools.reduce(lambda x, y: x * y, shape[:-ndims + 1], 1)
52 ] + shape[-ndims + 1:])
53
54
55def _FlatOuterDims(tensor, ndims=2):

Callers 1

_NumpyScatterNdFunction · 0.70

Calls 2

reshapeMethod · 0.80
reduceMethod · 0.45

Tested by

no test coverage detected