prior_boxes = torch.FloatTensor(prior_boxes).to(device) # (8732, 4)
prior_boxes.clamp_(0, 1) # (8732, 4)
what dooes clamp_ do in pytorch and how to change it to the tensorflow 2.0?
I'm not sure what clamp_ do exactly?
prior_boxes = torch.FloatTensor(prior_boxes).to(device) # (8732, 4)
prior_boxes.clamp_(0, 1) # (8732, 4)
what dooes clamp_ do in pytorch and how to change it to the tensorflow 2.0?
I'm not sure what clamp_ do exactly?
clamp_(0, 1)
Clamp all elements in prior_boxes
into the range [ 0, 1].
Tensorflow:
tf.clip_by_value
https://www.tensorflow.org/api_docs/python/tf/clip_by_value