MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / ConvModel

Class ConvModel

imperative/python/test/unit/module/test_module.py:548–571  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546def test_repr_basic():
547 # test whether __repr__ can output correct information
548 class ConvModel(Module):
549 def __init__(self):
550 super().__init__()
551 self.conv1 = Conv2d(3, 128, 3, padding=1, bias=False)
552 self.conv2 = Conv2d(3, 128, 3, dilation=2, bias=False)
553 self.bn1 = BatchNorm1d(128)
554 self.bn2 = BatchNorm2d(128)
555 self.pooling = MaxPool2d(kernel_size=2, padding=0)
556 modules = OrderedDict()
557 modules["depthwise"] = Conv2d(256, 256, 3, 1, 0, groups=256, bias=False,)
558 modules["pointwise"] = Conv2d(
559 256, 256, kernel_size=1, stride=1, padding=0, bias=True,
560 )
561 self.submodule1 = Sequential(modules)
562 self.list1 = [Dropout(drop_prob=0.1), [Softmax(axis=100)]]
563 self.tuple1 = (
564 Dropout(drop_prob=0.1),
565 (Softmax(axis=100), Dropout(drop_prob=0.2)),
566 )
567 self.dict1 = {"Dropout": Dropout(drop_prob=0.1)}
568 self.fc1 = Linear(512, 1024)
569
570 def forward(self, inputs):
571 pass
572
573 ground_truth = (
574 "ConvModel(\n"

Callers 1

test_repr_basicFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_repr_basicFunction · 0.68