Skip to content
Snippets Groups Projects
Commit b49c2a77 authored by Christian Fuß's avatar Christian Fuß
Browse files

fixed a problem with inferring size for OneHotLayer, when no 'size' parameter is given

parent a0fc79fc
Branches
No related tags found
1 merge request!17Shared code, updated for CNNArchLang, etc.
Pipeline #156330 failed
<#assign input = element.inputs[0]>
<#assign size = element.size>
<#if mode == "ARCHITECTURE_DEFINITION">
self.${element.name} = OneHot(size=${size})
<#include "OutputShape.ftl">
self.${element.name} = OneHot(size=${element.element.outputTypes[0].dimensions[0]})
<#include "OutputShape.ftl">
<#elseif mode == "FORWARD_FUNCTION">
${element.name} = self.${element.name}(${input})
<#elseif mode == "PYTHON_INLINE">
${element.name} = nd.one_hot(indices=${input}, depth=${size})
${element.name} = nd.one_hot(indices=${input}, depth=${element.element.outputTypes[0].dimensions[0]})
<#elseif mode == "CPP_INLINE">
vector<float> ${element.name}(${size}, 0);
vector<float> ${element.name}(${element.element.outputTypes[0].dimensions[0]}, 0);
${element.name}[${input}[0]] = 1;
</#if>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment