prompt stringlengths 94 42.6k | completion stringlengths 6 120 | api stringlengths 14 68 |
|---|---|---|
# 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 ARRANTIES OR CONDITIONS OF ANY ... | mgb.dtype.qint32(bias_scale) | megengine._internal.dtype.qint32 |
# -*- 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... | Parameter(v0) | megengine.core.Parameter |
# -*- 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... | Graph() | megengine.core.Graph |
#!/usr/bin/env python3
import argparse
import math
import megengine.functional as F
import megengine.module as M
import numpy as np
from megengine import jit, tensor
class ConvNet(M.Module):
def __init__(self):
super().__init__()
self.conv1 = M.Conv2d(in_channels=3, out_channels=1, kernel_size=... | jit.trace(symbolic=True, capture_as_const=True) | megengine.jit.trace |
#!/usr/bin/env python3
import argparse
import math
import megengine.functional as F
import megengine.module as M
import numpy as np
from megengine import jit, tensor
class ConvNet(M.Module):
def __init__(self):
super().__init__()
self.conv1 = | M.Conv2d(in_channels=3, out_channels=1, kernel_size=3, bias=False) | megengine.module.Conv2d |
# -*- 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... | mgb.opr.virtual_dep([x, self._checkpoint]) | megengine._internal.opr.virtual_dep |
# -*- 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... | mgb.cgtools.replace_vars(self._sym_outputs, replace) | megengine._internal.cgtools.replace_vars |
# -*- 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... | mgb.serialize_comp_graph_to_file(fpath, sym_outputs, append=append) | megengine._internal.serialize_comp_graph_to_file |
# -*- 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... | mgb.opr.virtual_dep(args) | megengine._internal.opr.virtual_dep |
# -*- 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... | CompGraphProfiler(cg) | megengine._internal.plugin.CompGraphProfiler |
# -*- 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... | mgb.comp_graph_tools.set_priority_to_id(self._outspec) | megengine._internal.comp_graph_tools.set_priority_to_id |
# -*- 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... | mgb.opr.callback_injector(s, callback) | megengine._internal.opr.callback_injector |
# -*- 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... | mgb.SharedND._from_symvar(s) | megengine._internal.SharedND._from_symvar |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | dist.init_process_group("localhost", 0, world_size, rank, dev, backend) | megengine.distributed.init_process_group |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | dist.init_process_group("localhost", port, world_size, rank, dev, backend) | megengine.distributed.init_process_group |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | tensor(data) | megengine.core.tensor |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | dist.functional.reduce_sum(inp) | megengine.distributed.functional.reduce_sum |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | tensor(data) | megengine.core.tensor |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | dist.functional.gather(inp) | megengine.distributed.functional.gather |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | tensor(data) | megengine.core.tensor |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | dist.functional.broadcast(inp) | megengine.distributed.functional.broadcast |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | tensor(data) | megengine.core.tensor |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | dist.functional.scatter(inp) | megengine.distributed.functional.scatter |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | tensor(data) | megengine.core.tensor |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | dist.functional.all_to_all(inp) | megengine.distributed.functional.all_to_all |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | tensor(data) | megengine.core.tensor |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | dist.functional.all_gather(inp) | megengine.distributed.functional.all_gather |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | tensor(data) | megengine.core.tensor |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | dist.functional.reduce_scatter_sum(inp) | megengine.distributed.functional.reduce_scatter_sum |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | tensor(data) | megengine.core.tensor |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | dist.functional.all_reduce_sum(inp) | megengine.distributed.functional.all_reduce_sum |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | tensor(data) | megengine.core.tensor |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | dist.functional.all_reduce_max(inp) | megengine.distributed.functional.all_reduce_max |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | tensor(data) | megengine.core.tensor |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | dist.functional.all_reduce_min(inp) | megengine.distributed.functional.all_reduce_min |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | Parameter(data) | megengine.core.Parameter |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | dist.functional.bcast_param(inp) | megengine.distributed.functional.bcast_param |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | dist.get_master_port() | megengine.distributed.get_master_port |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | mge.get_device_count("gpu") | megengine.get_device_count |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | mge.get_device_count("gpu") | megengine.get_device_count |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | mge.get_device_count("gpu") | megengine.get_device_count |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | mge.get_device_count("gpu") | megengine.get_device_count |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | mge.get_device_count("gpu") | megengine.get_device_count |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | mge.get_device_count("gpu") | megengine.get_device_count |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | mge.get_device_count("gpu") | megengine.get_device_count |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | mge.get_device_count("gpu") | megengine.get_device_count |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | mge.get_device_count("gpu") | megengine.get_device_count |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | mge.get_device_count("gpu") | megengine.get_device_count |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | mge.get_device_count("gpu") | megengine.get_device_count |
import os
import sys
import time
from collections import OrderedDict
from time import strftime, gmtime
from tensorboardX import SummaryWriter
from dataset import AsrDataset, DataLoader, AsrCollator
from models.transformer import Model
import hparams as hp
import argparse
import megengine as mge
import megengine.module ... | megengine.logger.get_logger() | megengine.logger.get_logger |
import os
import sys
import time
from collections import OrderedDict
from time import strftime, gmtime
from tensorboardX import SummaryWriter
from dataset import AsrDataset, DataLoader, AsrCollator
from models.transformer import Model
import hparams as hp
import argparse
import megengine as mge
import megengine.module ... | push_scope("clip_grad_norm") | megengine.core._imperative_rt.core2.push_scope |
import os
import sys
import time
from collections import OrderedDict
from time import strftime, gmtime
from tensorboardX import SummaryWriter
from dataset import AsrDataset, DataLoader, AsrCollator
from models.transformer import Model
import hparams as hp
import argparse
import megengine as mge
import megengine.module ... | minimum(scale, 1) | megengine.functional.minimum |
import os
import sys
import time
from collections import OrderedDict
from time import strftime, gmtime
from tensorboardX import SummaryWriter
from dataset import AsrDataset, DataLoader, AsrCollator
from models.transformer import Model
import hparams as hp
import argparse
import megengine as mge
import megengine.module ... | pop_scope("clip_grad_norm") | megengine.core._imperative_rt.core2.pop_scope |
import os
import sys
import time
from collections import OrderedDict
from time import strftime, gmtime
from tensorboardX import SummaryWriter
from dataset import AsrDataset, DataLoader, AsrCollator
from models.transformer import Model
import hparams as hp
import argparse
import megengine as mge
import megengine.module ... | mge.random.uniform(min, max, param.shape) | megengine.random.uniform |
import os
import sys
import time
from collections import OrderedDict
from time import strftime, gmtime
from tensorboardX import SummaryWriter
from dataset import AsrDataset, DataLoader, AsrCollator
from models.transformer import Model
import hparams as hp
import argparse
import megengine as mge
import megengine.module ... | F.copy(param.grad) | megengine.functional.copy |
import os
import sys
import time
from collections import OrderedDict
from time import strftime, gmtime
from tensorboardX import SummaryWriter
from dataset import AsrDataset, DataLoader, AsrCollator
from models.transformer import Model
import hparams as hp
import argparse
import megengine as mge
import megengine.module ... | RandomSampler(dataset=dataset, batch_size=hp.batch_size) | megengine.data.RandomSampler |
import os
import sys
import time
from collections import OrderedDict
from time import strftime, gmtime
from tensorboardX import SummaryWriter
from dataset import AsrDataset, DataLoader, AsrCollator
from models.transformer import Model
import hparams as hp
import argparse
import megengine as mge
import megengine.module ... | concat(norm_) | megengine.functional.concat |
import os
import sys
import time
from collections import OrderedDict
from time import strftime, gmtime
from tensorboardX import SummaryWriter
from dataset import AsrDataset, DataLoader, AsrCollator
from models.transformer import Model
import hparams as hp
import argparse
import megengine as mge
import megengine.module ... | mge.load(args.continue_path) | megengine.load |
import os
import sys
import time
from collections import OrderedDict
from time import strftime, gmtime
from tensorboardX import SummaryWriter
from dataset import AsrDataset, DataLoader, AsrCollator
from models.transformer import Model
import hparams as hp
import argparse
import megengine as mge
import megengine.module ... | dist.get_rank() | megengine.distributed.get_rank |
import os
import sys
import time
from collections import OrderedDict
from time import strftime, gmtime
from tensorboardX import SummaryWriter
from dataset import AsrDataset, DataLoader, AsrCollator
from models.transformer import Model
import hparams as hp
import argparse
import megengine as mge
import megengine.module ... | dist.get_world_size() | megengine.distributed.get_world_size |
import os
import sys
import time
from collections import OrderedDict
from time import strftime, gmtime
from tensorboardX import SummaryWriter
from dataset import AsrDataset, DataLoader, AsrCollator
from models.transformer import Model
import hparams as hp
import argparse
import megengine as mge
import megengine.module ... | autodiff.GradManager() | megengine.autodiff.GradManager |
import os
import sys
import time
from collections import OrderedDict
from time import strftime, gmtime
from tensorboardX import SummaryWriter
from dataset import AsrDataset, DataLoader, AsrCollator
from models.transformer import Model
import hparams as hp
import argparse
import megengine as mge
import megengine.module ... | dist.make_allreduce_cb("SUM") | megengine.distributed.make_allreduce_cb |
# Copyright (c) 2020 <NAME>
# This code is licensed under MIT license
# (https://github.com/kwotsin/mimicry/blob/master/LICENSE)
# ------------------------------------------------------------------------------
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megv... | F.mean(x, axis=1, keepdims=True) | megengine.functional.mean |
# Copyright (c) 2020 <NAME>
# This code is licensed under MIT license
# (https://github.com/kwotsin/mimicry/blob/master/LICENSE)
# ------------------------------------------------------------------------------
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megv... | F.mean((x - m) ** 2, axis=1, keepdims=True) | megengine.functional.mean |
# Copyright (c) 2020 <NAME>
# This code is licensed under MIT license
# (https://github.com/kwotsin/mimicry/blob/master/LICENSE)
# ------------------------------------------------------------------------------
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megv... | jit.trace(impl) | megengine.jit.trace |
# Copyright (c) 2020 <NAME>
# This code is licensed under MIT license
# (https://github.com/kwotsin/mimicry/blob/master/LICENSE)
# ------------------------------------------------------------------------------
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megv... | F.sqrt(v) | megengine.functional.sqrt |
# Copyright (c) 2020 <NAME>
# This code is licensed under MIT license
# (https://github.com/kwotsin/mimicry/blob/master/LICENSE)
# ------------------------------------------------------------------------------
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megv... | F.avg_pool2d(h, 2) | megengine.functional.avg_pool2d |
# Copyright (c) 2020 <NAME>
# This code is licensed under MIT license
# (https://github.com/kwotsin/mimicry/blob/master/LICENSE)
# ------------------------------------------------------------------------------
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megv... | F.clamp(p, lower=-3e-2, upper=3e-2) | megengine.functional.clamp |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return | M.ConvTranspose2d(ic, oc, 4, stride=2, padding=1) | megengine.module.ConvTranspose2d |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | M.Conv2d(ic, oc, 3, padding=1, stride=2) | megengine.module.Conv2d |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | F.dimshuffle(x, (0, 1, 4, 2, 5, 3)) | megengine.functional.dimshuffle |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, | M.LeakyReLU(0.1) | megengine.module.LeakyReLU |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, | M.Sigmoid() | megengine.module.Sigmoid |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | M.Conv2d(channels, channels, 3, 1, padding=1, bias=True) | megengine.module.Conv2d |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | M.Conv2d(channels, 16, kernel_size=1) | megengine.module.Conv2d |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | M.Conv2d(16, channels, kernel_size=1) | megengine.module.Conv2d |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | M.LeakyReLU(0.1) | megengine.module.LeakyReLU |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | M.LeakyReLU(0.1) | megengine.module.LeakyReLU |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | M.LeakyReLU(0.1) | megengine.module.LeakyReLU |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | M.Identity() | megengine.module.Identity |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | F.concat((conv3, conv2), 1) | megengine.functional.concat |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | F.concat((conv4, conv3), 1) | megengine.functional.concat |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | F.concat((conv5, conv4, conv2), 1) | megengine.functional.concat |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | F.concat((conv6, conv5, conv3), 1) | megengine.functional.concat |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | F.concat((conv7, conv6, conv4), 1) | megengine.functional.concat |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | F.concat((conv8, conv7, conv5), 1) | megengine.functional.concat |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | F.maximum(conv11 + x[:, 6:9], 0) | megengine.functional.maximum |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | M.Conv2d(in_channels, channels, 1, stride, bias=False) | megengine.module.Conv2d |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | F.concat((conv9, conv1), 1) | megengine.functional.concat |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | F.concat((conv10, conv0), 1) | megengine.functional.concat |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | M.AvgPool2d(kernel_size=stride, stride=stride) | megengine.module.AvgPool2d |
import megengine as mge
import megengine.module as M
import megengine.functional as F
from megengine.core import Parameter
from utils import *
def addLeakyRelu(x):
return M.Sequential(x, M.LeakyReLU(0.1))
def addSig(x):
return M.Sequential(x, M.Sigmoid())
def up_block(x, ic, oc):
return M.ConvTranspose2d... | M.Conv2d(in_channels, channels, 1, 1, bias=False) | megengine.module.Conv2d |
# MegFlow is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2019-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 ARRANTIES OR CONDITIONS OF ANY KI... | mge.load(sys.argv[1]) | megengine.load |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | Tensor(data, dtype=low_bit_type, device="xpux") | megengine.tensor.Tensor |
# 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 ARRANTIES OR CONDITIONS OF ANY ... | Tensor(data, dtype=low_bit_type, device="xpux") | megengine.tensor.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... | jit.trace(capture_as_const=True) | megengine.jit.trace |
# -*- 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... | F.concat([data.shape[0],M.shape]) | megengine.functional.concat |
# -*- 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... | F.broadcast_to(M, M_shape) | megengine.functional.broadcast_to |
# -*- 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... | F.vision.warp_perspective(out, M, (output_h, output_w), format='NHWC') | megengine.functional.vision.warp_perspective |
# -*- 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... | F.sub(out, _mean) | megengine.functional.sub |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.