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

Function _FlatOuterDims

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

Source from the content-addressed store, hash-verified

53
54
55def _FlatOuterDims(tensor, ndims=2):
56 shape = list(tensor.shape)
57 return tensor.reshape(shape[:ndims - 1] + [
58 functools.reduce(lambda x, y: x * y, shape[ndims - 1:], 1)
59 ])
60
61
62def _NumpyScatterNd(ref, indices, updates, op):

Callers 1

_NumpyScatterNdFunction · 0.70

Calls 2

reshapeMethod · 0.80
reduceMethod · 0.45

Tested by

no test coverage detected