MCPcopy
hub / github.com/OpenPPL/ppq / trans

Method trans

ppq/parser/caffe/caffe_import_utils.py:339–347  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

337@register_class
338class PReLU(CaffeOpBuilder):
339 def trans(self):
340 assert len(self.layer.blobs) == 1, 'PReLU lacks of slope'
341 dim_info = self.layer.blobs[0].shape.dim
342 # squeeze the PReLU slope [1, 128, 1, 1] to [1, 128] if input is 2-D
343 # prelu only has one input data
344 if len(dim_info) == 4 and len(self.input_shape[0]) == 2:
345 dim_info.pop()
346 dim_info.pop()
347 return super(PReLU, self).trans()
348
349
350@register_class

Callers 2

buildMethod · 0.45
transMethod · 0.45

Calls 1

popMethod · 0.45

Tested by

no test coverage detected