def test_onnx_name_2_pytorch_name(): assert onnx_name_2_pytorch_name( "ResNet/Sequential[layer3]/BasicBlock[0]/ReLU[relu]" ) == "layer3.0.relu" assert onnx_name_2_pytorch_name( 'VGG/[features]/Sequential/Conv2d[34]') == "features.34" assert onnx_name_2_pytorch_name('NameWithNoModule') == ''
def test_onnx_name_2_pytorch_name(): assert "layer3.0.relu1" == onnx_name_2_pytorch_name("ResNet/Sequential[layer3]/BasicBlock[0]/ReLU[relu].1", 'Relu') assert "features.34" == onnx_name_2_pytorch_name('VGG/[features]/Sequential/Conv2d[34]', 'Conv') assert "Relu3" == onnx_name_2_pytorch_name('NameWithNoModule.3', 'Relu')