title: 'Tensor' object has no attribute 'numpy' in tf.function in TF 2.0
body: <p>Is there any alternative to <code>tensor.numpy()</code> inside of a <code>tf.function</code> in TensorFlow 2.0? The problem is that when I try to use it in the decorated function, I get the error message <code>'Tensor' object has no attribute 'numpy'</code> while outside it runs without any problem. </p>
  
  <p>Normally, I would go for something like <code>tensor.eval()</code> but it can be used only in a TF session and there are no sessions anymore in TF 2.0.</p>