Created
October 4, 2017 18:57
-
-
Save zhreshold/d3104e77e7f8f90931ea058e1d64c917 to your computer and use it in GitHub Desktop.
HybridBlock of concat layer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mxnet.gluon import HybridBlock | |
class Concat(HybridBlock): | |
"""Concat operation for multiple inputs.""" | |
def __init__(self, dim=1, **kwargs): | |
super(Concat, self).__init__(**kwargs) | |
self._kwargs = {'dim': dim} | |
def hybrid_forward(self, F, *args): | |
return F.concat(*args, name='fwd', **self._kwargs) | |
def __repr__(self): | |
s = '{name}(dim={dim})' | |
return s.format(name=self.__class__.__name__, **self._kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use this block