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
Pipeline #156330 failed with stages
in 2 minutes and 49 seconds
<#assign input = element.inputs[0]>
<#assign size = element.size>
<#if mode == "ARCHITECTURE_DEFINITION">
self.${element.name} = OneHot(size=${size})
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
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