Skip to main content

EfficientViT_BImpl

EfficientViT_BImpl

#include <efficientvit.hpp>

Inherits from torch::nn::Module

Public Functions

Name
EfficientViT_BImpl(std::vector< int > num_blocks, std::vector< int > out_channels, int stem_width =8, std::vector< std::string > block_types ={“conv”, “conv”, “transform”, “transform”}, std::vector< int > expansions ={4, 4, 4, 4}, std::vector< bool > is_fused ={false, false, false, false}, int head_dimension =16, std::vector< int > output_filters ={1024, 1280}, std::vector< int > input_shape ={3, 224, 224}, float drop_connect_rate =0, float dropout =0, bool use_norm =true, bool anti_aliasing =false)
torch::nn::Sequential _make_blocks(int block_input_channels)
torch::Tensor forward(torch::Tensor x)

Public Attributes

Name
std::vector< int > num_blocks
std::vector< int > out_channels
std::vector< int > expansions
std::vector< int > output_filters
int stem_width
int head_dimension
bool use_norm
bool anti_aliasing
float drop_connect_rate
float dropout
Conv2dSame stem_conv
torch::nn::BatchNorm2d stem_bn
torch::nn::ReLU stem_activation
MBConv stem_mb_conv
torch::nn::Sequential _blocks
Conv2dSame features_conv
torch::nn::BatchNorm2d features_bn
std::vector< std::string > block_types
std::vector< bool > is_fused

Public Functions Documentation

function EfficientViT_BImpl

inline EfficientViT_BImpl(
    std::vector< int > num_blocks,
    std::vector< int > out_channels,
    int stem_width =8,
    std::vector< std::string > block_types ={"conv", "conv", "transform", "transform"},
    std::vector< int > expansions ={4, 4, 4, 4},
    std::vector< bool > is_fused ={false, false, false, false},
    int head_dimension =16,
    std::vector< int > output_filters ={1024, 1280},
    std::vector< int > input_shape ={3, 224, 224},
    float drop_connect_rate =0,
    float dropout =0,
    bool use_norm =true,
    bool anti_aliasing =false
)

function _make_blocks

inline torch::nn::Sequential _make_blocks(
    int block_input_channels
)

function forward

inline torch::Tensor forward(
    torch::Tensor x
)

Public Attributes Documentation

variable num_blocks

std::vector< int > num_blocks;

variable out_channels

std::vector< int > out_channels;

variable expansions

std::vector< int > expansions;

variable output_filters

std::vector< int > output_filters;

variable stem_width

int stem_width;

variable head_dimension

int head_dimension;

variable use_norm

bool use_norm;

variable anti_aliasing

bool anti_aliasing;

variable drop_connect_rate

float drop_connect_rate;

variable dropout

float dropout;

variable stem_conv

Conv2dSame stem_conv {nullptr};

variable stem_bn

torch::nn::BatchNorm2d stem_bn {nullptr};

variable stem_activation

torch::nn::ReLU stem_activation {torch::nn::ReLU()};

variable stem_mb_conv

MBConv stem_mb_conv {nullptr};

variable _blocks

torch::nn::Sequential _blocks;

variable features_conv

Conv2dSame features_conv {nullptr};

variable features_bn

torch::nn::BatchNorm2d features_bn {nullptr};

variable block_types

std::vector< std::string > block_types;

variable is_fused

std::vector< bool > is_fused;

Updated on 2026-11-13 at 20:25:39 +0000