Equivalent of slim.flatten in pytorch

In my model in Tensorflow, the code is as follows

pred_bb = slim.flatten(pred_bb)
#print(pred_bb)
pred_bb = tf.sigmoid(pred_bb)

I am reimplemwnting it in pytorch.
How can the slim.flatten be implemnted in pytorch.?

Thanks

probably pred_bb.view(-1)?

1 Like