prompt
stringlengths
94
42.6k
completion
stringlengths
6
120
api
stringlengths
14
68
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.concat(expanded_strides, 1)
megengine.functional.concat
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.concat(cls_targets, 0)
megengine.functional.concat
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.concat(reg_targets, 0)
megengine.functional.concat
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.concat(obj_targets, 0)
megengine.functional.concat
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.concat(fg_masks, 0)
megengine.functional.concat
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.log(gt[:, 2] / stride + eps)
megengine.functional.log
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.log(gt[:, 3] / stride + eps)
megengine.functional.log
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.stack([b_l, b_t, b_r, b_b], 2)
megengine.functional.stack
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.stack([c_l, c_t, c_r, c_b], 2)
megengine.functional.stack
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.zeros_like(cost)
megengine.functional.zeros_like
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.topk(ious_in_boxes_matrix, n_candidate_k, descending=True)
megengine.functional.topk
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.argmax(matching_matrix[:, fg_mask_inboxes], axis=0)
megengine.functional.argmax
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
M.init.fill_(conv.bias, bias_value)
megengine.module.init.fill_
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
M.init.fill_(conv.bias, bias_value)
megengine.module.init.fill_
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.transpose(outputs, (0, 2, 1))
megengine.functional.transpose
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.exp(output[..., 2:4])
megengine.functional.exp
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.exp(outputs[..., 2:4])
megengine.functional.exp
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.concat(origin_preds, 1)
megengine.functional.concat
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.concat(l1_targets, 0)
megengine.functional.concat
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
mge.Tensor(0.0)
megengine.Tensor
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.log(pair_wise_ious + 1e-8)
megengine.functional.log
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(x_shifts_per_image + 0.5 * expanded_strides_per_image, axis=0)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(y_shifts_per_image + 0.5 * expanded_strides_per_image, axis=0)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(gt_bboxes_per_image[:, 0] - 0.5 * gt_bboxes_per_image[:, 2], axis=1)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(gt_bboxes_per_image[:, 0] + 0.5 * gt_bboxes_per_image[:, 2], axis=1)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(gt_bboxes_per_image[:, 1] - 0.5 * gt_bboxes_per_image[:, 3], axis=1)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(gt_bboxes_per_image[:, 1] + 0.5 * gt_bboxes_per_image[:, 3], axis=1)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.topk(cost[gt_idx], k=dynamic_ks[gt_idx], descending=False)
megengine.functional.topk
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.argmin(cost[:, anchor_matching_gt > 1], axis=0)
megengine.functional.argmin
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.zeros(1)
megengine.functional.zeros
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.concat([reg_output, obj_output, cls_output], 1)
megengine.functional.concat
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.concat(outputs, 1)
megengine.functional.concat
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.arange(hsize)
megengine.functional.arange
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.arange(wsize)
megengine.functional.arange
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.transpose(output, (0, 1, 3, 4, 2))
megengine.functional.transpose
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.arange(hsize)
megengine.functional.arange
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.arange(wsize)
megengine.functional.arange
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.full((*shape, 1), stride)
megengine.functional.full
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.equal(gt, 1)
megengine.functional.equal
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.equal(gt, 0)
megengine.functional.equal
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.zeros((0, self.num_classes))
megengine.functional.zeros
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.zeros((0, 4))
megengine.functional.zeros
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.zeros((0, 4))
megengine.functional.zeros
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.zeros((total_num_anchors, 1))
megengine.functional.zeros
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(fg_mask, axis=-1)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(gt_bboxes_per_image[:, 0], axis=1)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(expanded_strides_per_image, axis=0)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(gt_bboxes_per_image[:, 0], axis=1)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(expanded_strides_per_image, axis=0)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(gt_bboxes_per_image[:, 1], axis=1)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(expanded_strides_per_image, axis=0)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(gt_bboxes_per_image[:, 1], axis=1)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(expanded_strides_per_image, axis=0)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.full((1, grid.shape[1]), stride_this_level)
megengine.functional.full
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.flatten(x, start_axis=2)
megengine.functional.flatten
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.stack((xv, yv), 2)
megengine.functional.stack
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.stack((xv, yv), 2)
megengine.functional.stack
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.log(pred+1e-5)
megengine.functional.log
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.pow(1-pred, 2)
megengine.functional.pow
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.log(1-pred+1e-5)
megengine.functional.log
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.pow(pred, 2)
megengine.functional.pow
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(pred_ious_this_matching, axis=-1)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.expand_dims(obj_preds_, axis=0)
megengine.functional.expand_dims
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.sqrt(cls_preds_)
megengine.functional.sqrt
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
mge.Tensor(reg_output)
megengine.Tensor
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.sigmoid(obj_output)
megengine.functional.sigmoid
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.sigmoid(cls_output)
megengine.functional.sigmoid
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.zeros(total_num_anchors)
megengine.functional.zeros
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.zeros((num_fg_img, 4))
megengine.functional.zeros
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.transpose(reg_output, (0, 1, 3, 4, 2))
megengine.functional.transpose
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import math import megengine as mge import megengine.functional as F import megengine.module as M from yolox.utils import bboxes_iou from .losses import binary_cross_entropy, iou_loss, l1_loss from .network_bloc...
F.sigmoid(obj_preds)
megengine.functional.sigmoid
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
tensor()
megengine.core.tensor
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
tensor()
megengine.core.tensor
import pytest import megengine as mge import megengine.functional as F from megengine.core._imperative_rt.core2 import config_async_level, get_async_level def test_basic():
config_async_level(2)
megengine.core._imperative_rt.core2.config_async_level
import pytest import megengine as mge import megengine.functional as F from megengine.core._imperative_rt.core2 import config_async_level, get_async_level def test_basic(): config_async_level(2) assert get_async_level() == 2 with pytest.raises(RuntimeError): config_async_level(3) def test_level...
config_async_level(1)
megengine.core._imperative_rt.core2.config_async_level
import pytest import megengine as mge import megengine.functional as F from megengine.core._imperative_rt.core2 import config_async_level, get_async_level def test_basic(): config_async_level(2) assert get_async_level() == 2 with pytest.raises(RuntimeError): config_async_level(3) def test_level...
mge.tensor([[1, 2], [2, 3], [3, 4]], dtype="float32")
megengine.tensor
import pytest import megengine as mge import megengine.functional as F from megengine.core._imperative_rt.core2 import config_async_level, get_async_level def test_basic(): config_async_level(2) assert get_async_level() == 2 with pytest.raises(RuntimeError): config_async_level(3) def test_level...
mge.tensor([1, 1], dtype="float32")
megengine.tensor
import pytest import megengine as mge import megengine.functional as F from megengine.core._imperative_rt.core2 import config_async_level, get_async_level def test_basic(): config_async_level(2) assert get_async_level() == 2 with pytest.raises(RuntimeError): config_async_level(3) def test_level...
config_async_level(2)
megengine.core._imperative_rt.core2.config_async_level
import pytest import megengine as mge import megengine.functional as F from megengine.core._imperative_rt.core2 import config_async_level, get_async_level def test_basic(): config_async_level(2) assert get_async_level() == 2 with pytest.raises(RuntimeError): config_async_level(3) def test_level...
mge.tensor([[1, 2, 2, 3]], dtype="float32")
megengine.tensor
import pytest import megengine as mge import megengine.functional as F from megengine.core._imperative_rt.core2 import config_async_level, get_async_level def test_basic(): config_async_level(2) assert get_async_level() == 2 with pytest.raises(RuntimeError): config_async_level(3) def test_level...
mge.tensor([1, 1])
megengine.tensor
import pytest import megengine as mge import megengine.functional as F from megengine.core._imperative_rt.core2 import config_async_level, get_async_level def test_basic(): config_async_level(2) assert get_async_level() == 2 with pytest.raises(RuntimeError): config_async_level(3) def test_level...
F.reshape(a, c)
megengine.functional.reshape
import pytest import megengine as mge import megengine.functional as F from megengine.core._imperative_rt.core2 import config_async_level, get_async_level def test_basic(): config_async_level(2) assert get_async_level() == 2 with pytest.raises(RuntimeError): config_async_level(3) def test_level...
config_async_level(1)
megengine.core._imperative_rt.core2.config_async_level
import pytest import megengine as mge import megengine.functional as F from megengine.core._imperative_rt.core2 import config_async_level, get_async_level def test_basic(): config_async_level(2) assert get_async_level() == 2 with pytest.raises(RuntimeError): config_async_level(3) def test_level...
mge.tensor([[1, 2]], dtype="float32")
megengine.tensor
import pytest import megengine as mge import megengine.functional as F from megengine.core._imperative_rt.core2 import config_async_level, get_async_level def test_basic(): config_async_level(2) assert
get_async_level()
megengine.core._imperative_rt.core2.get_async_level
import pytest import megengine as mge import megengine.functional as F from megengine.core._imperative_rt.core2 import config_async_level, get_async_level def test_basic(): config_async_level(2) assert get_async_level() == 2 with pytest.raises(RuntimeError):
config_async_level(3)
megengine.core._imperative_rt.core2.config_async_level
import pytest import megengine as mge import megengine.functional as F from megengine.core._imperative_rt.core2 import config_async_level, get_async_level def test_basic(): config_async_level(2) assert get_async_level() == 2 with pytest.raises(RuntimeError): config_async_level(3) def test_level...
F.reshape(a, c)
megengine.functional.reshape
import pytest import megengine as mge import megengine.functional as F from megengine.core._imperative_rt.core2 import config_async_level, get_async_level def test_basic(): config_async_level(2) assert get_async_level() == 2 with pytest.raises(RuntimeError): config_async_level(3) def test_level...
F.matmul(d, e)
megengine.functional.matmul
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
Tensor(data, device="xpux", dtype=np.int32)
megengine.Tensor
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
mge.save(a, f)
megengine.save
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
mge.load(f, map_location="cpux")
megengine.load
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
mge.is_cuda_available()
megengine.is_cuda_available
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
mge.get_default_device()
megengine.get_default_device
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
mge.set_default_device("gpu0")
megengine.set_default_device
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
mge.save(a, f)
megengine.save
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
mge.set_default_device("cpux")
megengine.set_default_device
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
mge.load(f, map_location={"gpu0": "cpu0"})
megengine.load
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
mge.set_default_device(device_org)
megengine.set_default_device
# -*- coding: utf-8 -*- # This repo is licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
_set_defrag(True)
megengine.core._imperative_rt.utils._set_defrag
# -*- coding: utf-8 -*- # This repo is licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
mge.get_logger(__name__)
megengine.get_logger
# -*- coding: utf-8 -*- # This repo is licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
mge.device.set_prealloc_config(1024, 1024, 256 * 1024 * 1024, 4.0)
megengine.device.set_prealloc_config