MCPcopy Create free account
hub / github.com/apache/tvm / dilate_np

Function dilate_np

python/tvm/topi/testing/conv1d_ncw_python.py:25–45  ·  view source on GitHub ↗

1D dilation using numpy Parameters ---------- x : numpy.ndarray Array to dilate with shape [batch, in_channel, in_width] dilation : int dilation rate of output Returns ------- out : numpy.ndarray Dilated output with shape [batch, in_channel, (in

(x, dilation)

Source from the content-addressed store, hash-verified

23
24
25def dilate_np(x, dilation):
26 """1D dilation using numpy
27
28 Parameters
29 ----------
30 x : numpy.ndarray
31 Array to dilate with shape [batch, in_channel, in_width]
32
33 dilation : int
34 dilation rate of output
35
36 Returns
37 -------
38 out : numpy.ndarray
39 Dilated output with shape [batch, in_channel, (in_width - 1) * dilation + 1]
40 """
41 irange = range(len(x) - 1)
42 for d in range(dilation - 1):
43 indices = [(d + 1) * (i + 1) for i in irange]
44 x = np.insert(x, indices, 0)
45 return x
46
47
48def group_conv1d_ncw_python(a_np, w_np, stride, padding, dilation, groups):

Callers 1

conv1d_ncw_pythonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…