Commit d7a94b18 authored by danielkisov's avatar danielkisov
Browse files

fixing error giving imports when no custom layers are present

parent 7e8a7089
Pipeline #456499 failed with stage
in 28 seconds
......@@ -46,7 +46,6 @@ public class CNNArch2GluonLayerSupportChecker extends LayerSupportChecker {
supportedLayerList.add(AllPredefinedLayers.DOT_PRODUCT_SELF_ATTENTION_NAME);
supportedLayerList.add(AllPredefinedLayers.LOAD_NETWORK_NAME);
supportedLayerList.add(AllPredefinedLayers.LAYERNORM_NAME);
supportedLayerList.add(AllPredefinedLayers.CUSTOM_LAYER);
}
}
......@@ -7,8 +7,10 @@ import warnings
import inspect
import sys
<#if tc.architecture.customPyFilesPath??>
sys.path.insert(1, '${tc.architecture.customPyFilesPath}')
from custom_layers import *
</#if>
<#list tc.architecture.networkInstructions as networkInstruction>
from CNNNet_${tc.fullArchitectureName} import Net_${networkInstruction?index}
......@@ -218,4 +220,4 @@ class ${tc.fileNameWithoutEnding}:
def validate_parameters(self):
<#list tc.architecture.networkInstructions as networkInstruction>
${tc.include(networkInstruction.body, "PARAMETER_VALIDATION")}
</#list>
\ No newline at end of file
</#list> pass
\ No newline at end of file
......@@ -8,8 +8,10 @@ import warnings
import sys
from mxnet import gluon, nd
<#if tc.architecture.customPyFilesPath??>
sys.path.insert(1, '${tc.architecture.customPyFilesPath}')
from custom_layers import *
</#if>
class ZScoreNormalization(gluon.HybridBlock):
......
......@@ -14,8 +14,7 @@ try:
import AdamW
except:
pass
sys.path.insert(1, '${tc.architecture.customPyFilesPath}')
from custom_optimizers import *
class CrossEntropyLoss(gluon.loss.Loss):
def __init__(self, axis=-1, sparse_label=True, weight=None, batch_axis=0, **kwargs):
......
<#-- (c) https://github.com/MontiCore/monticore -->
<#assign input = element.inputs[0]>
<#if mode == "ARCHITECTURE_DEFINITION">
<#if element.element.arguments?has_content>
self.${element.name} = ${element.element.name}.${element.element.name}(<#rt>
<#list element.element.arguments as argument>
${argument.name}=${argument.rhs.value.get()}<#sep>, </#sep><#t>
</#list>)<#t>
<#else>
self.${element.name} = ${element.element.name}.${element.element.name}()
</#if>
</#list>)<#lt>
<#include "OutputShape.ftl">
<#elseif mode == "FORWARD_FUNCTION">
${element.name} = self.${element.name}(${input})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment