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

Method _unwrap_or_tile

tensorflow/python/ops/parallel_for/pfor.py:1207–1213  ·  view source on GitHub ↗

Given a wrapped tensor, unwrap if stacked. Otherwise, tiles it.

(self, wrapped_tensor)

Source from the content-addressed store, hash-verified

1205 result, dtype=values.dtype, rank=sparse_tensor_rank)
1206
1207 def _unwrap_or_tile(self, wrapped_tensor):
1208 """Given a wrapped tensor, unwrap if stacked. Otherwise, tiles it."""
1209 output, is_stacked = wrapped_tensor.t, wrapped_tensor.is_stacked
1210 if is_stacked:
1211 return output
1212 else:
1213 return _stack(output, self._loop_len_vector).t
1214
1215 def convert(self, y):
1216 """Returns the converted value corresponding to y.

Callers 3

_convert_sparseMethod · 0.95
convertMethod · 0.95
_convert_helperMethod · 0.95

Calls 1

_stackFunction · 0.85

Tested by

no test coverage detected