Skip to content

Why not directly cut the picture into quarters, but need the following operation? #8

@Pandaxia8

Description

@Pandaxia8
def downsample_concatenate(X, kernel):
    b, h, w, c = X.shape
    Y = X.contiguous().view(b, h, w // kernel, c * kernel)
    Y = Y.permute(0, 2, 1, 3).contiguous()
    Y = Y.view(b, w // kernel, h // kernel, kernel * kernel * c).contiguous()
    Y = Y.permute(0, 2, 1, 3).contiguous()
    return Y

I don't understand why not directly cut the pictures into quarters, could you tell me what will happen if I just replace the above codes with the following? Thank you! :)

def downsample_concatenate(X, kernel):
    b, h, w, c = X.shape
    Y = X.contiguous().view(b, h//kernel, w // kernel, c * kernel*kernel)
    return Y

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions