prompt
stringlengths
94
42.6k
completion
stringlengths
6
120
api
stringlengths
14
68
import functools import numpy as np import pytest import megengine from megengine.autodiff.grad_manager import GradManager from megengine.core.ops.builtin import GetVarShape, Reduce, TypeCvt from megengine.core.tensor.utils import subgraph_fn from megengine.device import CompNode, get_default_device from megengine.ji...
GetVarShape()
megengine.core.ops.builtin.GetVarShape
import functools import numpy as np import pytest import megengine from megengine.autodiff.grad_manager import GradManager from megengine.core.ops.builtin import GetVarShape, Reduce, TypeCvt from megengine.core.tensor.utils import subgraph_fn from megengine.device import CompNode, get_default_device from megengine.ji...
Reduce(mode="product", axis=0)
megengine.core.ops.builtin.Reduce
import functools import numpy as np import pytest import megengine from megengine.autodiff.grad_manager import GradManager from megengine.core.ops.builtin import GetVarShape, Reduce, TypeCvt from megengine.core.tensor.utils import subgraph_fn from megengine.device import CompNode, get_default_device from megengine.ji...
Reduce(mode="product", axis=0)
megengine.core.ops.builtin.Reduce
import functools import numpy as np import pytest import megengine from megengine.autodiff.grad_manager import GradManager from megengine.core.ops.builtin import GetVarShape, Reduce, TypeCvt from megengine.core.tensor.utils import subgraph_fn from megengine.device import CompNode, get_default_device from megengine.ji...
TypeCvt(dtype=dtype)
megengine.core.ops.builtin.TypeCvt
import functools import numpy as np import pytest import megengine from megengine.autodiff.grad_manager import GradManager from megengine.core.ops.builtin import GetVarShape, Reduce, TypeCvt from megengine.core.tensor.utils import subgraph_fn from megengine.device import CompNode, get_default_device from megengine.ji...
Reduce(mode="sum")
megengine.core.ops.builtin.Reduce
import functools import numpy as np import pytest import megengine from megengine.autodiff.grad_manager import GradManager from megengine.core.ops.builtin import GetVarShape, Reduce, TypeCvt from megengine.core.tensor.utils import subgraph_fn from megengine.device import CompNode, get_default_device from megengine.ji...
Reduce(mode="sum_sqr")
megengine.core.ops.builtin.Reduce
import functools import numpy as np import pytest import megengine from megengine.autodiff.grad_manager import GradManager from megengine.core.ops.builtin import GetVarShape, Reduce, TypeCvt from megengine.core.tensor.utils import subgraph_fn from megengine.device import CompNode, get_default_device from megengine.ji...
trace(symbolic=symbolic)
megengine.jit.trace
import functools import numpy as np import pytest import megengine from megengine.autodiff.grad_manager import GradManager from megengine.core.ops.builtin import GetVarShape, Reduce, TypeCvt from megengine.core.tensor.utils import subgraph_fn from megengine.device import CompNode, get_default_device from megengine.ji...
trace(symbolic=symbolic)
megengine.jit.trace
import functools import numpy as np import pytest import megengine from megengine.autodiff.grad_manager import GradManager from megengine.core.ops.builtin import GetVarShape, Reduce, TypeCvt from megengine.core.tensor.utils import subgraph_fn from megengine.device import CompNode, get_default_device from megengine.ji...
GradManager()
megengine.autodiff.grad_manager.GradManager
import functools import numpy as np import pytest import megengine from megengine.autodiff.grad_manager import GradManager from megengine.core.ops.builtin import GetVarShape, Reduce, TypeCvt from megengine.core.tensor.utils import subgraph_fn from megengine.device import CompNode, get_default_device from megengine.ji...
GradManager()
megengine.autodiff.grad_manager.GradManager
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) Megvii, Inc. and its affiliates. import random import megengine as mge import megengine.distributed as dist import megengine.functional as F class DataPrefetcher: """ DataPrefetcher is inspired by code of following file: https://github.com/NV...
mge.tensor([1])
megengine.tensor
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) Megvii, Inc. and its affiliates. import random import megengine as mge import megengine.distributed as dist import megengine.functional as F class DataPrefetcher: """ DataPrefetcher is inspired by code of following file: https://github.com/NV...
F.distributed.broadcast(tensor)
megengine.functional.distributed.broadcast
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) Megvii, Inc. and its affiliates. import random import megengine as mge import megengine.distributed as dist import megengine.functional as F class DataPrefetcher: """ DataPrefetcher is inspired by code of following file: https://github.com/NV...
dist.group_barrier()
megengine.distributed.group_barrier
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.abs(x)
megengine.functional.abs
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.abs(pred - target)
megengine.functional.abs
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.abs(pred - max_overlaps)
megengine.functional.abs
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.equal(label, ignore_label)
megengine.functional.equal
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.equal(label, ignore_label)
megengine.functional.equal
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.ones([n, m, 1])
megengine.functional.ones
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.log(pred)
megengine.functional.log
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.log(1 - pred)
megengine.functional.log
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.zeros([n, m, c + 1])
megengine.functional.zeros
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.expand_dims(vlabel, 2)
megengine.functional.expand_dims
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.pow(1 - pred, gamma)
megengine.functional.pow
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.pow(pred, gamma)
megengine.functional.pow
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.equal(label, background)
megengine.functional.equal
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.equal(label, ignore_label)
megengine.functional.equal
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.equal(label, ignore_label)
megengine.functional.equal
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.equal(gt, background)
megengine.functional.equal
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.equal(gt, ignore_label)
megengine.functional.equal
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(
F.exp(pred)
megengine.functional.exp
import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def softmax_loss(pred, label, ignore_label=-1): max_pred = pred.max(axis=1, keepdims=True).detach() pred -= max_pred log_prob = pred - F.log(F.exp(pred).sum(axis=1, keepdims=True)) mask =...
F.exp(pred)
megengine.functional.exp
# -*- 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...
trace(symbolic=trace_mode)
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...
tensor([1])
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...
trace(symbolic=trace_mode)
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...
tensor([1])
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...
trace(symbolic=trace_mode, opt_level=2)
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...
optim.SGD([w], lr=0.01, momentum=0.9, weight_decay=5e-4)
megengine.optimizer.SGD
# -*- 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...
trace(symbolic=trace_mode, opt_level=2)
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...
trace(symbolic=True, 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...
AutoNaming.clear()
megengine.utils.naming.AutoNaming.clear
# -*- 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([2])
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...
tensor([4])
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...
cgtools.GraphInference(file)
megengine.utils.comp_graph_tools.GraphInference
# -*- 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([2])
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...
trace(symbolic=True, 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...
tensor([3])
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...
cgtools.GraphInference(file)
megengine.utils.comp_graph_tools.GraphInference
# -*- 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([2])
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...
trace(symbolic=True, 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...
tensor([3])
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...
G.load_graph(file)
megengine.core.tensor.megbrain_graph.load_graph
# -*- 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...
trace(symbolic=trace_mode, profiling=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...
tensor([1])
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...
trace(symbolic=True, opt_level=0, 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...
trace(symbolic=True, opt_level=1, 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...
tensor(0.0)
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...
trace(symbolic=True, opt_level=0, 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...
trace(symbolic=True, opt_level=1, 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...
tensor(val)
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...
tensor(0.0)
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...
trace(symbolic=True, opt_level=0, 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...
trace(symbolic=True, opt_level=1, 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...
G.load_graph(out)
megengine.core.tensor.megbrain_graph.load_graph
# -*- 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...
cgtools.get_oprs_seq(outputs)
megengine.utils.comp_graph_tools.get_oprs_seq
# -*- 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...
G.load_graph(out)
megengine.core.tensor.megbrain_graph.load_graph
# -*- 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...
cgtools.get_oprs_seq(outputs)
megengine.utils.comp_graph_tools.get_oprs_seq
# -*- 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...
trace(symbolic=True, 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...
G.load_graph(out)
megengine.core.tensor.megbrain_graph.load_graph
# -*- 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...
trace(capture_as_const=True, symbolic_shape=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...
tensor([0], 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...
trace(symbolic=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...
trace(symbolic=trace_mode, 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...
tensor([5, 2, 7, 1, 0, 3, 2])
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...
trace(symbolic=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...
trace(symbolic=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...
tensor([1, 2, 3, 4])
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...
tensor([5, 6, 7, 8])
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...
tensor([9, 0, 1, 2])
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...
trace(symbolic=trace_mode, 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...
trace(symbolic=False)
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...
trace(symbolic=False)
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...
trace(symbolic=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...
trace(symbolic=symbolic)
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.topk(c, 3)
megengine.functional.topk
# -*- 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...
trace(symbolic=symbolic)
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...
tensor([1])
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...
tensor(1.0)
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...
tensor(1.0)
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...
exp(x)
megengine.functional.exp
# -*- 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(5.0)
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...
isscalar(b)
megengine.core.tensor.utils.isscalar
# -*- 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.topk(x, 3)
megengine.functional.topk
# -*- 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(x, M, (2, 2))
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.broadcast_to(x, (3, 4, 5))
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.nms(boxes, scores=scores, iou_thresh=0.5, max_output=20)
megengine.functional.vision.nms
# -*- 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([2])
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...
tensor([2])
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...
F.broadcast_to(x, 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.clip(x, lower, upper)
megengine.functional.clip