MCPcopy Index your code
hub / github.com/numpy/numpy / _set_pad_area

Function _set_pad_area

numpy/lib/_arraypad_impl.py:130–152  ·  view source on GitHub ↗

Set empty-padded area in given dimension. Parameters ---------- padded : ndarray Array with the pad area which is modified inplace. axis : int Dimension with the pad area to set. width_pair : (int, int) Pair of widths that mark the pad area on both s

(padded, axis, width_pair, value_pair)

Source from the content-addressed store, hash-verified

128
129
130def _set_pad_area(padded, axis, width_pair, value_pair):
131 """
132 Set empty-padded area in given dimension.
133
134 Parameters
135 ----------
136 padded : ndarray
137 Array with the pad area which is modified inplace.
138 axis : int
139 Dimension with the pad area to set.
140 width_pair : (int, int)
141 Pair of widths that mark the pad area on both sides in the given
142 dimension.
143 value_pair : tuple of scalars or ndarrays
144 Values inserted into the pad area on each side. It must match or be
145 broadcastable to the shape of `arr`.
146 """
147 left_slice = _slice_at_axis(slice(None, width_pair[0]), axis)
148 padded[left_slice] = value_pair[0]
149
150 right_slice = _slice_at_axis(
151 slice(padded.shape[axis] - width_pair[1], None), axis)
152 padded[right_slice] = value_pair[1]
153
154
155def _get_edges(padded, axis, width_pair):

Callers 1

padFunction · 0.85

Calls 2

_slice_at_axisFunction · 0.85
sliceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…