You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

concat.py 778 B

123456789101112131415161718192021
  1. # MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
  2. #
  3. # Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
  4. #
  5. # Unless required by applicable law or agreed to in writing,
  6. # software distributed under the License is distributed on an
  7. # "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8. from typing import Iterable
  9. from ..functional import concat
  10. from ..tensor import Tensor
  11. from .module import Module
  12. class Concat(Module):
  13. r"""A :class:`~.Module` to do functional :func:`~.concat`. Could be replaced with :class:`~.QATModule`
  14. version :class:`~.qat.Concat` using :func:`~.quantize.quantize_qat`.
  15. """
  16. def forward(self, inps: Iterable[Tensor], axis: int = 0):
  17. return concat(inps, axis)