Solved by ptrblck in post #2 
              
              
                That’s strange indeed. 
It seems that a call to _infer_size() in binary_cross_entropy() is throwing this error. 
For a workaround you could try creating the weight tensor with dims [36, 1, 1, 1].