wrap¶
- class torchvision.tv_tensors.wrap(wrappee, *, like, **kwargs)[source]¶
Convert a
torch.Tensor(wrappee) into the sameTVTensorsubclass aslike.If
likeis aBoundingBoxes, theformatandcanvas_sizeoflikeare assigned towrappee, unless they are passed askwargs.- Parameters:
wrappee (Tensor) – The tensor to convert.
like (
TVTensor) – The reference.wrappeewill be converted into the same subclass aslike.kwargs – Can contain “format” and “canvas_size” if
likeis aBoundingBoxes. Ignored otherwise.
Examples using
wrap: