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

Method Map

tensorflow/compiler/xla/shape_tree.h:267–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265 // Maps each element to generate a new tree with the same shape.
266 template <typename U>
267 ShapeTree<U> Map(const std::function<U(const T&)>& func) {
268 ShapeTree<U> result(shape_storage_);
269 ForEachElement([&](const ShapeIndex& index, const T& t) {
270 *result.mutable_element(index) = func(t);
271 });
272 return result;
273 }
274
275 template <typename U>
276 ShapeTree<U> Map(const std::function<U(T*)>& func) {

Callers

nothing calls this directly

Calls 2

funcFunction · 0.50
mutable_elementMethod · 0.45

Tested by

no test coverage detected