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

Function InsertBroadcastLabels

tensorflow/core/kernels/einsum_op.cc:178–187  ·  view source on GitHub ↗

Insert new (unnamed) broadcasting labels at the location of ellipsis.

Source from the content-addressed store, hash-verified

176
177// Insert new (unnamed) broadcasting labels at the location of ellipsis.
178void InsertBroadcastLabels(int num_bcast_dims, int num_named_labels,
179 int ellipsis_axis, Labels* labels,
180 LabelCounts* label_counts) {
181 labels->erase(labels->begin() + ellipsis_axis);
182 labels->insert(labels->begin() + ellipsis_axis, num_bcast_dims, 0);
183 std::iota(labels->begin() + ellipsis_axis,
184 labels->begin() + ellipsis_axis + num_bcast_dims, num_named_labels);
185 // Increment label counts. Since these are new labels, the count is set to 1.
186 label_counts->resize(num_named_labels + num_bcast_dims, 1);
187}
188
189// Record and validate the label to dimension mapping. Must be a named
190// (non-broadcasting) label as broadcasting labels don't have a fixed dimension.

Callers 1

ProcessDimensionsFunction · 0.85

Calls 4

eraseMethod · 0.45
beginMethod · 0.45
insertMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected