Skip to content

The MACs value of the GRU is abnormal #55

@jay678

Description

@jay678

calflops version is: 0.3.2
code:
from calflops import calculate_flops
gru = nn.GRU(input_size=128, hidden_size=128, num_layers=1, batch_first=True)
input_tensor = torch.randn(10, 32, 128) # (seq_len, batch_size, input_size)
flops, macs, params = calculate_flops(gru, (10, 32, 128), output_as_string=True, print_results=True, print_detailed=True)
print(" calflops: flops:", flops, " param:", params, "macs:", macs)

############################################
test result:
GRU(99.07 K = 100% Params, 0 MACs = 0% MACs, 63.2 MFLOPS = 100% FLOPs, 128, 128, batch_first=True)

calflops: flops: 63.2 MFLOPS param: 99.07 K macs: 0 MACs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions