Caffe2 - Python API
A deep learning, cross platform ML framework
Public Member Functions | Public Attributes | List of all members
caffe2.python.layers.concat.Concat Class Reference
Inheritance diagram for caffe2.python.layers.concat.Concat:

Public Member Functions

def __init__ (self, model, input_record, axis=1, add_axis=0, name='concat', kwargs)
def add_ops (self, net)

Public Attributes


Detailed Description

Construct Concat layer
Assume that first dimension is batch,


    embedding_dim = 64
    input_record = self.new_record(schema.Struct(
        ('input1', schema.Scalar((np.float32, (embedding_dim, )))),
        ('input2', schema.Scalar((np.float32, (embedding_dim, )))),
        ('input3', schema.Scalar((np.float32, (embedding_dim, )))),

    output = self.model.Concat(input_record)
        schema.Scalar((np.float32, ((len(input_record.fields) * embedding_dim, )))),

    # Note that in Concat layer we assume first dimension is batch.
    # so input is B * embedding_dim
    # add_axis=1 make it B * 1 * embedding_dim
    # Concat on axis=1 make it B * N * embedding_dim

    output = self.model.Concat(input_record, axis=1, add_axis=1)
        schema.Scalar((np.float32, ((len(input_record.fields), embedding_dim)))),

Definition at line 33 of file

The documentation for this class was generated from the following file: