MCPcopy
hub / github.com/apache/tvm / fully_connected_inference

Function fully_connected_inference

python/tvm/contrib/nnpack.py:33–57  ·  view source on GitHub ↗

Create an extern op that compute fully connected of 1D tensor lhs and 2D tensor rhs with nnpack. Parameters ---------- lhs : Tensor lhs 1D array input[input_channels] of FP32 elements rhs : Tensor lhs 2D matrix kernel[output_channels][input_channels] of FP32 elem

(lhs, rhs, nthreads=1)

Source from the content-addressed store, hash-verified

31
32
33def fully_connected_inference(lhs, rhs, nthreads=1):
34 """Create an extern op that compute fully connected of 1D tensor lhs and
35 2D tensor rhs with nnpack.
36
37 Parameters
38 ----------
39 lhs : Tensor
40 lhs 1D array input[input_channels] of FP32 elements
41 rhs : Tensor
42 lhs 2D matrix kernel[output_channels][input_channels] of FP32 elements
43
44 Returns
45 -------
46 C : Tensor
47 lhs 1D array out[output_channels] of FP32 elements.
48 """
49 m = rhs.shape[0]
50 return te.extern(
51 (m,),
52 [lhs, rhs],
53 lambda ins, outs: tvm.tirx.call_packed(
54 "tvm.contrib.nnpack.fully_connected_inference", ins[0], ins[1], outs[0], nthreads
55 ),
56 name="C",
57 )
58
59
60class ConvolutionAlgorithm:

Callers

nothing calls this directly

Calls 1

call_packedMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…