Skip to content

Commit

Permalink
remove script classes (pytorch#2210)
Browse files Browse the repository at this point in the history
Co-authored-by: eellison <eellison@fb.com>
  • Loading branch information
2 people authored and fmassa committed Jun 9, 2020
1 parent ef67e1d commit 25081d0
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 7 deletions.
2 changes: 0 additions & 2 deletions torchvision/io/_video_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

# simple class for torch scripting
# the complex Fraction class from fractions module is not scriptable
@torch.jit.script
class Timebase(object):
__annotations__ = {"numerator": int, "denominator": int}
__slots__ = ["numerator", "denominator"]
Expand All @@ -41,7 +40,6 @@ def __init__(
self.denominator = denominator


@torch.jit.script
class VideoMetaData(object):
__annotations__ = {
"has_video": bool,
Expand Down
3 changes: 0 additions & 3 deletions torchvision/models/detection/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def zeros_like(tensor, dtype):
device=tensor.device, pin_memory=tensor.is_pinned())


@torch.jit.script
class BalancedPositiveNegativeSampler(object):
"""
This class samples batches, ensuring that they contain a fixed proportion of positives
Expand Down Expand Up @@ -133,7 +132,6 @@ def encode_boxes(reference_boxes, proposals, weights):
return targets


@torch.jit.script
class BoxCoder(object):
"""
This class encodes and decodes a set of bounding boxes into
Expand Down Expand Up @@ -228,7 +226,6 @@ def decode_single(self, rel_codes, boxes):
return pred_boxes


@torch.jit.script
class Matcher(object):
"""
This class assigns to each predicted "element" (e.g., a box) a ground-truth
Expand Down
1 change: 0 additions & 1 deletion torchvision/models/detection/image_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from torch import Tensor


@torch.jit.script
class ImageList(object):
"""
Structure that holds a list of images (of possibly
Expand Down
1 change: 0 additions & 1 deletion torchvision/ops/poolers.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def initLevelMapper(k_min, k_max, canonical_scale=224, canonical_level=4, eps=1e
return LevelMapper(k_min, k_max, canonical_scale, canonical_level, eps)


@torch.jit.script
class LevelMapper(object):
"""Determine which FPN level each RoI in a set of RoIs should map to based
on the heuristic in the FPN paper.
Expand Down

0 comments on commit 25081d0

Please sign in to comment.