How does binary-crossentropy decide the output In Keras and tensorflow there is a loss function called binary crossentropy. When i use that the output neurons will only produce 0 and 1. 
I see that in the code of keras, binary cross entropy is linked to sigmoid_cross_entropy_with_logits in tensorflow, and from there I assume it goes on to a c++ implementation.
I'd like to know how exactly is it decided whether it's 0 or 1. Is it simply rounding the output? I would like to know because I want create a custom loss function which will have weights and want to make sure I'm not introducing any bias.
 A: 
When i use that the output neurons will only produce 0 and 1.

Cross-entropy produces scores in $[0,\infty)$. 
Examining the expression for cross-entropy should make this clear. For model parameters $\theta$, labels $y$ and predicted probabilities $p_i$, it is: 
$$
\mathcal{L}(\theta)= -\frac{1}{n}\sum_{i=1}^n \left[y_i \log(p_i) + (1-y_i)\log(1-p_i) \right]
$$
The function sigmoid_cross_entropy_loss_with_logits is evaluating an equivalent expression that takes $\text{logit}(p_i)$ as inputs; this can be numerically nicer. (Working though the algebra of the above equation will provide you with the exact expression that the function sigmoid_cross_entropy_loss_with_logits is evaluating.)
All of this to say: the output of the function sigmoid_cross_entropy_loss_with_logits cannot possibly be binary for all outputs. Are you post-processing the probabilities or logits in some way? It is very common for people to employ argmax to coerce outcomes to be binary, 1-hot representations of class membership.
To answer the titular question, binary cross entropy loss doesn’t decide the outputs. It just scores “how wrong” the model is; larger values imply the model is “more wrong.”
