Commit 66240de5 authored by lr119628's avatar lr119628
Browse files

[update] artificialArchCLass ftl

parent 7887e398
<#assign input = element.inputs[0]>
<#if mode == "ARTIFICIAL_ARCH_CLASS" >
<#assign name = element.element.name>
<#assign args = element.element.arguments>
class architecture_defined_block_${name}(gluon.HyrbidBlock):
<#if mode == "ARTIFICIAL_ARCH_CLASS">
class architecture_defined_block_${name}(gluon.HybridBlock):
def __init__(self, **kwargs):
super(architecture_defined_block_${name}, self).__init__(**kwargs)
with self.name_scope():
${tc.include(element.element,"ARCHITECTURE_DEFINITION")}
pass
def hybrid_forward(self, ${input}):
${tc.include(element.element,"FORWARD_FUNCTION")}
return [[<#list element.element.getLastAtomicElements() as el><#if el?index ==0>${tc.getName(el)}<#else>,tc.getName(el)</#if></#list>]]
${tc.include(element.element,"ARCHITECTURE_DEFINITION")}
def hybrid_forward(self,F, ${input}):
${tc.include(element.element,"FORWARD_FUNCTION")}
return <#list element.element.getLastAtomicElements() as el><#if el?index ==0>${tc.getName(el)}<#else>,tc.getName(el)</#if></#list>
</#if>
......
Supports Markdown
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