Unverified Commit 222a599e authored by eellison's avatar eellison Committed by GitHub
Browse files

remove script classes (#2210)


Co-authored-by: default avatareellison <eellison@fb.com>
parent 7ed3950e
...@@ -34,7 +34,6 @@ default_timebase = Fraction(0, 1) ...@@ -34,7 +34,6 @@ default_timebase = Fraction(0, 1)
# simple class for torch scripting # simple class for torch scripting
# the complex Fraction class from fractions module is not scriptable # the complex Fraction class from fractions module is not scriptable
@torch.jit.script
class Timebase(object): class Timebase(object):
__annotations__ = {"numerator": int, "denominator": int} __annotations__ = {"numerator": int, "denominator": int}
__slots__ = ["numerator", "denominator"] __slots__ = ["numerator", "denominator"]
...@@ -49,7 +48,6 @@ class Timebase(object): ...@@ -49,7 +48,6 @@ class Timebase(object):
self.denominator = denominator self.denominator = denominator
@torch.jit.script
class VideoMetaData(object): class VideoMetaData(object):
__annotations__ = { __annotations__ = {
"has_video": bool, "has_video": bool,
......
...@@ -13,7 +13,6 @@ def zeros_like(tensor, dtype): ...@@ -13,7 +13,6 @@ def zeros_like(tensor, dtype):
device=tensor.device, pin_memory=tensor.is_pinned()) device=tensor.device, pin_memory=tensor.is_pinned())
@torch.jit.script
class BalancedPositiveNegativeSampler(object): class BalancedPositiveNegativeSampler(object):
""" """
This class samples batches, ensuring that they contain a fixed proportion of positives This class samples batches, ensuring that they contain a fixed proportion of positives
...@@ -131,7 +130,6 @@ def encode_boxes(reference_boxes, proposals, weights): ...@@ -131,7 +130,6 @@ def encode_boxes(reference_boxes, proposals, weights):
return targets return targets
@torch.jit.script
class BoxCoder(object): class BoxCoder(object):
""" """
This class encodes and decodes a set of bounding boxes into This class encodes and decodes a set of bounding boxes into
...@@ -226,7 +224,6 @@ class BoxCoder(object): ...@@ -226,7 +224,6 @@ class BoxCoder(object):
return pred_boxes return pred_boxes
@torch.jit.script
class Matcher(object): class Matcher(object):
""" """
This class assigns to each predicted "element" (e.g., a box) a ground-truth This class assigns to each predicted "element" (e.g., a box) a ground-truth
......
...@@ -4,7 +4,6 @@ from torch.jit.annotations import List, Tuple ...@@ -4,7 +4,6 @@ from torch.jit.annotations import List, Tuple
from torch import Tensor from torch import Tensor
@torch.jit.script
class ImageList(object): class ImageList(object):
""" """
Structure that holds a list of images (of possibly Structure that holds a list of images (of possibly
......
...@@ -38,7 +38,6 @@ def initLevelMapper(k_min, k_max, canonical_scale=224, canonical_level=4, eps=1e ...@@ -38,7 +38,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) return LevelMapper(k_min, k_max, canonical_scale, canonical_level, eps)
@torch.jit.script
class LevelMapper(object): class LevelMapper(object):
"""Determine which FPN level each RoI in a set of RoIs should map to based """Determine which FPN level each RoI in a set of RoIs should map to based
on the heuristic in the FPN paper. on the heuristic in the FPN paper.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment