I’m looking for an equivalent of TensorFlow in Pytorch
binary_test = tf.cast(binary > 0.5, tf.float32)

I tried;
binary_test = binary.type(float32)
binary_test = torch.where(binary_test > 0.5, x, y)

where,   x = Tensor([1]), y = Tensor([0])
On doing so the python kernel crashes.