未验证 提交 a2821a01 编写于 作者: N Nyakku Shigure 提交者: GitHub

[CodeStyle] remove tabs in python fluid unittests (#46357)

上级 3448afc1
...@@ -31,7 +31,7 @@ class TestEyeOp(OpTest): ...@@ -31,7 +31,7 @@ class TestEyeOp(OpTest):
def setUp(self): def setUp(self):
''' '''
Test eye op with specified shape Test eye op with specified shape
''' '''
self.python_api = paddle.eye self.python_api = paddle.eye
self.op_type = "eye" self.op_type = "eye"
...@@ -52,7 +52,7 @@ class TestEyeOp1(OpTest): ...@@ -52,7 +52,7 @@ class TestEyeOp1(OpTest):
def setUp(self): def setUp(self):
''' '''
Test eye op with default parameters Test eye op with default parameters
''' '''
self.python_api = paddle.eye self.python_api = paddle.eye
self.op_type = "eye" self.op_type = "eye"
......
...@@ -231,10 +231,10 @@ def _box_to_delta(ex_boxes, gt_boxes, weights): ...@@ -231,10 +231,10 @@ def _box_to_delta(ex_boxes, gt_boxes, weights):
def _expand_bbox_targets(bbox_targets_input, class_nums, is_cls_agnostic): def _expand_bbox_targets(bbox_targets_input, class_nums, is_cls_agnostic):
class_labels = bbox_targets_input[:, 0] class_labels = bbox_targets_input[:, 0]
fg_inds = np.where(class_labels > 0)[0] fg_inds = np.where(class_labels > 0)[0]
#if is_cls_agnostic: # if is_cls_agnostic:
# class_labels = [1 if ll > 0 else 0 for ll in class_labels] # class_labels = [1 if ll > 0 else 0 for ll in class_labels]
# class_labels = np.array(class_labels, dtype=np.int32) # class_labels = np.array(class_labels, dtype=np.int32)
# class_nums = 2 # class_nums = 2
bbox_targets = np.zeros((class_labels.shape[0], bbox_targets = np.zeros((class_labels.shape[0],
4 * class_nums if not is_cls_agnostic else 4 * 2)) 4 * class_nums if not is_cls_agnostic else 4 * 2))
bbox_inside_weights = np.zeros(bbox_targets.shape) bbox_inside_weights = np.zeros(bbox_targets.shape)
......
...@@ -213,7 +213,7 @@ def filter_boxes(boxes, min_size, im_info, pixel_offset=True): ...@@ -213,7 +213,7 @@ def filter_boxes(boxes, min_size, im_info, pixel_offset=True):
def iou(box_a, box_b, pixel_offset=True): def iou(box_a, box_b, pixel_offset=True):
""" """
Apply intersection-over-union overlap between box_a and box_b Apply intersection-over-union overlap between box_a and box_b
""" """
xmin_a = min(box_a[0], box_a[2]) xmin_a = min(box_a[0], box_a[2])
ymin_a = min(box_a[1], box_a[3]) ymin_a = min(box_a[1], box_a[3])
......
...@@ -1041,8 +1041,8 @@ class TestRecomputeOptimizer(unittest.TestCase): ...@@ -1041,8 +1041,8 @@ class TestRecomputeOptimizer(unittest.TestCase):
def test_dropout_with_seed(self): def test_dropout_with_seed(self):
""" """
when we recompute a dropout op, make sure that the recomputed one when we recompute a dropout op, make sure that the recomputed one
is the same as the original var. is the same as the original var.
""" """
def gen_data(): def gen_data():
return { return {
......
...@@ -619,7 +619,7 @@ class RecurrentOpStopGradientTest(RecurrentOpTest1): ...@@ -619,7 +619,7 @@ class RecurrentOpStopGradientTest(RecurrentOpTest1):
h_t = \sigma (W x_t + U h_{t-1}) h_t = \sigma (W x_t + U h_{t-1})
weights: weights:
- W - W
- U - U
vars: vars:
- x - x
memories: memories:
......
...@@ -132,7 +132,7 @@ def filter_boxes(boxes, min_size, im_shape, pixel_offset=True): ...@@ -132,7 +132,7 @@ def filter_boxes(boxes, min_size, im_shape, pixel_offset=True):
def iou(box_a, box_b, pixel_offset=True): def iou(box_a, box_b, pixel_offset=True):
""" """
Apply intersection-over-union overlap between box_a and box_b Apply intersection-over-union overlap between box_a and box_b
""" """
xmin_a = min(box_a[0], box_a[2]) xmin_a = min(box_a[0], box_a[2])
ymin_a = min(box_a[1], box_a[3]) ymin_a = min(box_a[1], box_a[3])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册