title: Loss tensor being pruned out of graph in PopART
body: <p>I’ve written a very simple PopART program using the C++ interface, but every time I try to compile it to run on an IPU device I get the following error:</p>
  <pre><code>terminate called after throwing an instance of ‘popart::error’ 
    what(): Could not find loss tensor ‘L1:0’ in main graph tensors 
  </code></pre>
  <p>I’m defining the loss in my program like so:</p>
  <pre><code>auto loss = builder-&gt;aiGraphcoreOpset1().l1loss({outputs[0]}, 0.1f, popart::ReductionType::Sum, “l1LossVal”); 
  </code></pre>
  <p>Is there something wrong with my loss definition that’s resulting in it being pruned out of the graph? I’ve followed the same structure as one of the Graphcore examples <a href="https://github.com/graphcore/examples/blob/master/code_examples/popart/custom_operators/cube_op_example/cube_fn_custom_op.cpp" rel="nofollow noreferrer">here</a>.</p>