예제 #1
0
 def f(x):
     x = -x
     with exclude_from_trace():
         if i % 2:
             x = -x
     x = -x
     return x
예제 #2
0
 def f(boxes, scores):
     # with tracing, max_output must be specified
     results = F.nn.nms(boxes, scores=scores, iou_thresh=0.5, max_output=20)
     # without tracing, max output can be inferred inside nms
     with exclude_from_trace():
         _ = F.nn.nms(boxes, scores=scores, iou_thresh=0.5)
     return results
예제 #3
0
 def f(x):
     neg = ops.Elemwise(Elemwise.Mode.NEGATE)
     (x, ) = apply(neg, x)
     with exclude_from_trace():
         if i % 2:
             (x, ) = apply(neg, x)
     (x, ) = apply(neg, x)
     return x
예제 #4
0
 def f(x):
     neg = ops.Elemwise(mode="negate")
     (x, ) = apply(neg, x)
     with exclude_from_trace():
         if i % 2:
             (x, ) = apply(neg, x)
     (x, ) = apply(neg, x)
     return x
예제 #5
0
 def f(boxes, scores):
     results = F.nn.nms(boxes, scores=scores, iou_thresh=0.5, max_output=20)
     with exclude_from_trace():
         _ = F.nn.nms(boxes, scores=scores, iou_thresh=0.5)
     return results