Home / Class/ MicroBenchmarks Class — pytorch Architecture

MicroBenchmarks Class — pytorch Architecture

Architecture documentation for the MicroBenchmarks class in microbench.py from the pytorch codebase.

Entity Profile

Source Code

benchmarks/dynamo/microbenchmarks/microbench.py lines 74–97

class MicroBenchmarks:
    @staticmethod
    def add(a, b):
        return (a + b,)

    @staticmethod
    def scale(x, m, d):
        return ((x - m) / torch.clip(d, 1e-4),)

    @staticmethod
    def abs_norm(x):
        return (x / (torch.abs(x) + 1),)

    @staticmethod
    def add_relu_softmax(x, a):
        return (torch.softmax(torch.relu(x + a), -1),)

    @staticmethod
    def sum(a, b):
        return ((a + b).sum(),)

    @staticmethod
    def view(x):
        return (aten.alias(x),)

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free