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>
self.${} = OneHot(size=${size})
<#include "OutputShape.ftl">
self.${} = OneHot(size=${element.element.outputTypes[0].dimensions[0]})
<#include "OutputShape.ftl">
<#elseif mode == "FORWARD_FUNCTION">
${} = self.${}(${input})
<#elseif mode == "PYTHON_INLINE">
${} = nd.one_hot(indices=${input}, depth=${size})
${} = nd.one_hot(indices=${input}, depth=${element.element.outputTypes[0].dimensions[0]})
<#elseif mode == "CPP_INLINE">
vector<float> ${}(${size}, 0);
vector<float> ${}(${element.element.outputTypes[0].dimensions[0]}, 0);
${}[${input}[0]] = 1;
\ 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