SYMBOL INDEX (455 symbols across 36 files) FILE: src/open_clip/coca_model.py class MultimodalCfg (line 51) | class MultimodalCfg(CLIPTextCfg): function _build_text_decoder_tower (line 59) | def _build_text_decoder_tower( function _token_to_tensor (line 85) | def _token_to_tensor(token_id, device: str = "cpu") -> torch.Tensor: class CoCa (line 93) | class CoCa(nn.Module): method __init__ (line 94) | def __init__( method set_grad_checkpointing (line 150) | def set_grad_checkpointing(self, enable: bool = True): method _encode_image (line 155) | def _encode_image(self, images, normalize: bool = True): method _encode_text (line 160) | def _encode_text(self, text, normalize: bool = True): method encode_image (line 165) | def encode_image(self, images, normalize: bool = True): method encode_text (line 169) | def encode_text(self, text, normalize: bool = True): method forward_intermediates (line 173) | def forward_intermediates( method forward (line 255) | def forward( method generate (line 290) | def generate( method _generate_beamsearch (line 417) | def _generate_beamsearch( function prepare_inputs_for_generation (line 567) | def prepare_inputs_for_generation(input_ids, image_inputs, past=None, **... FILE: src/open_clip/convert.py function load_big_vision_weights (line 13) | def load_big_vision_weights(model: CustomTextCLIP, checkpoint_path: str): function convert_mobile_clip_state_dict (line 158) | def convert_mobile_clip_state_dict(model: CustomTextCLIP, state_dict, fa... function convert_state_dict (line 199) | def convert_state_dict(model: Union[CustomTextCLIP, CLIP], state_dict): FILE: src/open_clip/factory.py function _natural_key (line 28) | def _natural_key(string_): function _rescan_model_configs (line 32) | def _rescan_model_configs(): function list_models (line 56) | def list_models(): function add_model_config (line 61) | def add_model_config(path): function parse_model_name (line 73) | def parse_model_name(model_name: str) -> Tuple[Optional[str], str]: function _get_hf_config (line 119) | def _get_hf_config( function get_model_config (line 135) | def get_model_config(model_name): function load_state_dict (line 153) | def load_state_dict( function load_checkpoint (line 181) | def load_checkpoint( function _find_checkpoint_in_dir (line 228) | def _find_checkpoint_in_dir(dir_path: Path) -> Optional[str]: function create_model (line 251) | def create_model( function get_tokenizer (line 628) | def get_tokenizer( function _set_model_device_and_precision (line 758) | def _set_model_device_and_precision( function create_loss (line 790) | def create_loss(args): function create_model_and_transforms (line 829) | def create_model_and_transforms( function create_model_from_pretrained (line 968) | def create_model_from_pretrained( FILE: src/open_clip/hf_model.py class BaseModelOutput (line 20) | class BaseModelOutput: class PretrainedConfig (line 24) | class PretrainedConfig: function _camel2snake (line 31) | def _camel2snake(s): function register_pooler (line 39) | def register_pooler(cls): class MeanPooler (line 46) | class MeanPooler(nn.Module): method forward (line 49) | def forward(self, x: BaseModelOutput, attention_mask: TensorType): class MaxPooler (line 55) | class MaxPooler(nn.Module): method forward (line 58) | def forward(self, x: BaseModelOutput, attention_mask: TensorType): class ClsPooler (line 64) | class ClsPooler(nn.Module): method __init__ (line 67) | def __init__(self, use_pooler_output=True): method forward (line 72) | def forward(self, x: BaseModelOutput, attention_mask: TensorType): class ClsLastHiddenStatePooler (line 83) | class ClsLastHiddenStatePooler(nn.Module): method __init__ (line 88) | def __init__(self): method forward (line 92) | def forward(self, x: BaseModelOutput, attention_mask: TensorType): class HFTextEncoder (line 96) | class HFTextEncoder(nn.Module): method __init__ (line 100) | def __init__( method forward (line 154) | def forward(self, x: TensorType): method lock (line 171) | def lock(self, unlocked_layers: int = 0, freeze_layer_norm: bool = True): method set_grad_checkpointing (line 189) | def set_grad_checkpointing(self, enable=True): method init_parameters (line 192) | def init_parameters(self): FILE: src/open_clip/loss.py function gather_features (line 21) | def gather_features( class ClipLoss (line 68) | class ClipLoss(nn.Module): method __init__ (line 70) | def __init__( method get_ground_truth (line 91) | def get_ground_truth(self, device, num_logits) -> torch.Tensor: method get_logits (line 104) | def get_logits(self, image_features, text_features, logit_scale, logit... method forward (line 132) | def forward( class CoCaLoss (line 158) | class CoCaLoss(ClipLoss): method __init__ (line 159) | def __init__( method forward (line 184) | def forward(self, image_features, text_features, logits, labels, logit... class DistillClipLoss (line 203) | class DistillClipLoss(ClipLoss): method dist_loss (line 205) | def dist_loss(self, teacher_logits, student_logits): method forward (line 208) | def forward( function neighbour_exchange (line 242) | def neighbour_exchange(from_rank, to_rank, tensor, group=None): function neighbour_exchange_bidir (line 262) | def neighbour_exchange_bidir(left_rank, right_rank, tensor_to_left, tens... class NeighbourExchange (line 295) | class NeighbourExchange(torch.autograd.Function): method forward (line 297) | def forward(ctx, from_rank, to_rank, group, tensor): method backward (line 304) | def backward(ctx, grad_output): function neighbour_exchange_with_grad (line 308) | def neighbour_exchange_with_grad(from_rank, to_rank, tensor, group=None): class NeighbourExchangeBidir (line 312) | class NeighbourExchangeBidir(torch.autograd.Function): method forward (line 314) | def forward(ctx, left_rank, right_rank, group, tensor_to_left, tensor_... method backward (line 321) | def backward(ctx, *grad_outputs): function neighbour_exchange_bidir_with_grad (line 326) | def neighbour_exchange_bidir_with_grad(left_rank, right_rank, tensor_to_... class SigLipLoss (line 330) | class SigLipLoss(nn.Module): method __init__ (line 340) | def __init__( method get_ground_truth (line 358) | def get_ground_truth(self, device, dtype, num_logits, negative_only=Fa... method get_logits (line 364) | def get_logits(self, image_features, text_features, logit_scale, logit... method _loss (line 370) | def _loss(self, image_features, text_features, logit_scale, logit_bias... method forward (line 381) | def forward(self, image_features, text_features, logit_scale, logit_bi... FILE: src/open_clip/model.py class CLIPVisionCfg (line 35) | class CLIPVisionCfg: class CLIPTextCfg (line 75) | class CLIPTextCfg: function get_cast_dtype (line 115) | def get_cast_dtype(precision: str): function get_input_dtype (line 124) | def get_input_dtype(precision: str): function _build_vision_tower (line 133) | def _build_vision_tower( function _build_text_tower (line 209) | def _build_text_tower( class CLIP (line 265) | class CLIP(nn.Module): method __init__ (line 268) | def __init__( method lock_image_tower (line 304) | def lock_image_tower(self, unlocked_groups=0, freeze_bn_stats=False): method lock_text_tower (line 308) | def lock_text_tower(self, unlocked_layers: int = 0, freeze_layer_norm:... method set_grad_checkpointing (line 313) | def set_grad_checkpointing(self, enable=True): method no_weight_decay (line 318) | def no_weight_decay(self): method encode_image (line 326) | def encode_image(self, image, normalize: bool = False): method encode_text (line 330) | def encode_text(self, text, normalize: bool = False): method get_logits (line 347) | def get_logits(self, image, text): method forward_intermediates (line 356) | def forward_intermediates( method forward (line 459) | def forward( class CustomTextCLIP (line 482) | class CustomTextCLIP(nn.Module): method __init__ (line 485) | def __init__( method lock_image_tower (line 511) | def lock_image_tower(self, unlocked_groups=0, freeze_bn_stats=False): method lock_text_tower (line 515) | def lock_text_tower(self, unlocked_layers: int = 0, freeze_layer_norm:... method set_grad_checkpointing (line 519) | def set_grad_checkpointing(self, enable=True): method no_weight_decay (line 524) | def no_weight_decay(self): method encode_image (line 535) | def encode_image(self, image, normalize: bool = False): method encode_text (line 539) | def encode_text(self, text, normalize: bool = False): method get_logits (line 543) | def get_logits(self, image, text): method forward_intermediates (line 552) | def forward_intermediates( method forward (line 642) | def forward( function convert_weights_to_lp (line 665) | def convert_weights_to_lp(model: nn.Module, dtype=torch.float16): function convert_to_custom_text_state_dict (line 699) | def convert_to_custom_text_state_dict(state_dict: dict): function build_model_from_openai_state_dict (line 717) | def build_model_from_openai_state_dict( function trace_model (line 776) | def trace_model(model, batch_size=256, device=torch.device('cpu')): function resize_pos_embed (line 792) | def resize_pos_embed(state_dict, model, interpolation: str = 'bicubic', ... function resize_text_pos_embed (line 826) | def resize_text_pos_embed(state_dict, model, interpolation: str = 'linea... function get_model_preprocess_cfg (line 859) | def get_model_preprocess_cfg(model): function set_model_preprocess_cfg (line 876) | def set_model_preprocess_cfg(model, preprocess_cfg: Dict[str, Any]): function get_model_tokenize_cfg (line 883) | def get_model_tokenize_cfg(model): FILE: src/open_clip/modified_resnet.py class Bottleneck (line 11) | class Bottleneck(nn.Module): method __init__ (line 14) | def __init__(self, inplanes, planes, stride=1): method forward (line 43) | def forward(self, x: torch.Tensor): class AttentionPool2d (line 59) | class AttentionPool2d(nn.Module): method __init__ (line 60) | def __init__(self, spacial_dim: int, embed_dim: int, num_heads: int, o... method forward (line 69) | def forward(self, x): class ModifiedResNet (line 96) | class ModifiedResNet(nn.Module): method __init__ (line 104) | def __init__( method _make_layer (line 140) | def _make_layer(self, planes, blocks, stride=1): method init_parameters (line 149) | def init_parameters(self): method lock (line 162) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method set_grad_checkpointing (line 170) | def set_grad_checkpointing(self, enable=True): method stem (line 174) | def stem(self, x): method forward_intermediates (line 181) | def forward_intermediates( method forward (line 228) | def forward(self, x): FILE: src/open_clip/openai.py function list_openai_models (line 19) | def list_openai_models() -> List[str]: function load_openai_model (line 24) | def load_openai_model( FILE: src/open_clip/pos_embed.py function get_2d_sincos_pos_embed (line 20) | def get_2d_sincos_pos_embed(embed_dim, grid_size, cls_token=False): function get_2d_sincos_pos_embed_from_grid (line 38) | def get_2d_sincos_pos_embed_from_grid(embed_dim, grid): function get_1d_sincos_pos_embed_from_grid (line 49) | def get_1d_sincos_pos_embed_from_grid(embed_dim, pos): function interpolate_pos_embed (line 75) | def interpolate_pos_embed(model, checkpoint_model): FILE: src/open_clip/pretrained.py function _pcfg (line 40) | def _pcfg(url='', hf_hub='', **kwargs): function _slpcfg (line 53) | def _slpcfg(url='', hf_hub='', **kwargs): function _apcfg (line 66) | def _apcfg(url='', hf_hub='', **kwargs): function _mccfg (line 79) | def _mccfg(url='', hf_hub='', **kwargs): function _mc2cfg (line 92) | def _mc2cfg(url='', hf_hub='', **kwargs): function _pecfg (line 105) | def _pecfg(url='', hf_hub='', **kwargs): function _clean_tag (line 742) | def _clean_tag(tag: str): function list_pretrained (line 747) | def list_pretrained(as_str: bool = False): function list_pretrained_models_by_tag (line 754) | def list_pretrained_models_by_tag(tag: str): function list_pretrained_tags_by_model (line 764) | def list_pretrained_tags_by_model(model: str): function is_pretrained_cfg (line 772) | def is_pretrained_cfg(model: str, tag: str): function get_pretrained_cfg (line 778) | def get_pretrained_cfg(model: str, tag: str): function get_pretrained_url (line 785) | def get_pretrained_url(model: str, tag: str): function download_pretrained_from_url (line 790) | def download_pretrained_from_url( function has_hf_hub (line 836) | def has_hf_hub(necessary=False): function _get_safe_alternatives (line 844) | def _get_safe_alternatives(filename: str) -> Iterable[str]: function download_pretrained_from_hf (line 857) | def download_pretrained_from_hf( function download_pretrained (line 894) | def download_pretrained( FILE: src/open_clip/push_to_hf_hub.py function save_config_for_hf (line 35) | def save_config_for_hf( function save_for_hf (line 58) | def save_for_hf( function push_to_hf_hub (line 85) | def push_to_hf_hub( function push_pretrained_to_hf_hub (line 156) | def push_pretrained_to_hf_hub( function generate_readme (line 209) | def generate_readme(model_card: dict, model_name: str): FILE: src/open_clip/timm_model.py class TimmModel (line 23) | class TimmModel(nn.Module): method __init__ (line 27) | def __init__( method lock (line 105) | def lock(self, unlocked_groups: int = 0, freeze_bn_stats: bool = False): method set_grad_checkpointing (line 138) | def set_grad_checkpointing(self, enable: bool = True): method forward_intermediates (line 144) | def forward_intermediates( method set_input_size (line 195) | def set_input_size(self, image_size: Union[int, Tuple[int, int]]): method forward (line 212) | def forward(self, x): FILE: src/open_clip/tokenizer.py function default_bpe (line 27) | def default_bpe(): function bytes_to_unicode (line 32) | def bytes_to_unicode(): function get_pairs (line 54) | def get_pairs(word): function basic_clean (line 66) | def basic_clean(text): function whitespace_clean (line 72) | def whitespace_clean(text): function _clean_canonicalize (line 78) | def _clean_canonicalize(x): function _clean_lower (line 83) | def _clean_lower(x): function _clean_whitespace (line 88) | def _clean_whitespace(x): function get_clean_fn (line 93) | def get_clean_fn(type: str): function canonicalize_text (line 104) | def canonicalize_text( class SimpleTokenizer (line 133) | class SimpleTokenizer(object): method __init__ (line 134) | def __init__( method bpe (line 172) | def bpe(self, token): method encode (line 213) | def encode(self, text): method decode (line 221) | def decode(self, tokens): method __call__ (line 226) | def __call__(self, texts: Union[str, List[str]], context_length: Optio... function decode (line 271) | def decode(output_ids: torch.Tensor): function tokenize (line 276) | def tokenize(texts: Union[str, List[str]], context_length: int = DEFAULT... function random_mask_tokenize (line 280) | def random_mask_tokenize( function simple_mask_tokenize (line 309) | def simple_mask_tokenize( function syntax_mask_tokenize (line 331) | def syntax_mask_tokenize( function get_reduction_mask_fn (line 390) | def get_reduction_mask_fn(type: str): class HFTokenizer (line 405) | class HFTokenizer: method __init__ (line 408) | def __init__( method save_pretrained (line 465) | def save_pretrained(self, dest): method __call__ (line 468) | def __call__(self, texts: Union[str, List[str]], context_length: Optio... method set_language (line 501) | def set_language(self, src_lang): method _clips_tokenize (line 507) | def _clips_tokenize(self, texts: List[str], context_length: int) -> to... method _pad_and_add_class_token (line 537) | def _pad_and_add_class_token( class SigLipTokenizer (line 557) | class SigLipTokenizer: method __init__ (line 572) | def __init__( method save_pretrained (line 601) | def save_pretrained(self, dest): method __call__ (line 604) | def __call__(self, texts: Union[str, List[str]], context_length: Optio... FILE: src/open_clip/transform.py class PreprocessCfg (line 18) | class PreprocessCfg: method __post_init__ (line 27) | def __post_init__(self): method num_channels (line 31) | def num_channels(self): method input_size (line 35) | def input_size(self): function merge_preprocess_dict (line 41) | def merge_preprocess_dict( function merge_preprocess_kwargs (line 58) | def merge_preprocess_kwargs(base: PreprocessCfg, **kwargs): class AugmentationCfg (line 63) | class AugmentationCfg: function _setup_size (line 76) | def _setup_size(size, error_msg): class ResizeKeepRatio (line 89) | class ResizeKeepRatio: method __init__ (line 95) | def __init__( method get_params (line 117) | def get_params( method __call__ (line 145) | def __call__(self, img): method __repr__ (line 161) | def __repr__(self): function center_crop_or_pad (line 168) | def center_crop_or_pad(img: torch.Tensor, output_size: List[int], fill=0... class CenterCropOrPad (line 208) | class CenterCropOrPad(torch.nn.Module): method __init__ (line 220) | def __init__(self, size, fill=0): method forward (line 225) | def forward(self, img): method __repr__ (line 235) | def __repr__(self) -> str: class MaybeConvertMode (line 239) | class MaybeConvertMode: method __init__ (line 243) | def __init__(self, mode="RGB") -> None: method __call__ (line 247) | def __call__(self, pic): method __repr__ (line 261) | def __repr__(self) -> str: function _convert_to_rgb (line 265) | def _convert_to_rgb(image): class MaybeToTensor (line 269) | class MaybeToTensor(ToTensor): method __init__ (line 273) | def __init__(self) -> None: method __call__ (line 276) | def __call__(self, pic) -> torch.Tensor: method __repr__ (line 288) | def __repr__(self) -> str: class color_jitter (line 292) | class color_jitter(object): method __init__ (line 296) | def __init__(self, brightness=0., contrast=0., saturation=0., hue=0., ... method __call__ (line 301) | def __call__(self, img): class gray_scale (line 308) | class gray_scale(object): method __init__ (line 312) | def __init__(self, p=0.2): method __call__ (line 317) | def __call__(self, img): function image_transform (line 324) | def image_transform( function image_transform_v2 (line 443) | def image_transform_v2( FILE: src/open_clip/transformer.py class LayerNormFp32 (line 14) | class LayerNormFp32(nn.LayerNorm): method forward (line 17) | def forward(self, x: torch.Tensor): class LayerNorm (line 23) | class LayerNorm(nn.LayerNorm): method forward (line 26) | def forward(self, x: torch.Tensor): class QuickGELU (line 32) | class QuickGELU(nn.Module): method forward (line 34) | def forward(self, x: torch.Tensor): class LayerScale (line 38) | class LayerScale(nn.Module): method __init__ (line 39) | def __init__(self, dim, init_values=1e-5, inplace=False): method forward (line 44) | def forward(self, x): class PatchDropout (line 48) | class PatchDropout(nn.Module): method __init__ (line 53) | def __init__( method forward (line 63) | def forward(self, x): class Attention (line 92) | class Attention(nn.Module): method __init__ (line 93) | def __init__( method forward (line 157) | def forward(self, x, attn_mask: Optional[torch.Tensor] = None): class AttentionalPooler (line 215) | class AttentionalPooler(nn.Module): method __init__ (line 216) | def __init__( method forward (line 230) | def forward(self, x: torch.Tensor): class ResidualAttentionBlock (line 238) | class ResidualAttentionBlock(nn.Module): method __init__ (line 239) | def __init__( method get_weight_dtype (line 267) | def get_weight_dtype(self) -> torch.dtype: method attention (line 272) | def attention( method forward (line 289) | def forward( class CustomResidualAttentionBlock (line 303) | class CustomResidualAttentionBlock(nn.Module): method __init__ (line 304) | def __init__( method get_weight_dtype (line 346) | def get_weight_dtype(self) -> torch.dtype: method forward (line 351) | def forward(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] =... class CustomTransformer (line 357) | class CustomTransformer(nn.Module): method __init__ (line 359) | def __init__( method get_cast_dtype (line 400) | def get_cast_dtype(self) -> torch.dtype: method forward_intermediates (line 403) | def forward_intermediates( method prune_intermediate_layers (line 434) | def prune_intermediate_layers(self, indices: Union[int, List[int]] = 1): method forward (line 441) | def forward(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] =... class Transformer (line 457) | class Transformer(nn.Module): method __init__ (line 458) | def __init__( method get_cast_dtype (line 522) | def get_cast_dtype(self) -> torch.dtype: method forward_intermediates (line 525) | def forward_intermediates( method prune_intermediate_layers (line 556) | def prune_intermediate_layers(self, indices: Union[int, List[int]] = 1): method forward (line 563) | def forward(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] =... function _expand_token (line 579) | def _expand_token(token, batch_size: int): class VisionTransformer (line 583) | class VisionTransformer(nn.Module): method __init__ (line 586) | def __init__( method lock (line 710) | def lock(self, unlocked_groups: int = 0, freeze_bn_stats: bool = False): method init_parameters (line 743) | def init_parameters(self): method set_grad_checkpointing (line 764) | def set_grad_checkpointing(self, enable: bool = True): method no_weight_decay (line 768) | def no_weight_decay(self): method _global_pool (line 773) | def _global_pool(self, x: torch.Tensor) -> Tuple[torch.Tensor, torch.T... method _embeds (line 783) | def _embeds(self, x:torch.Tensor) -> torch.Tensor: method _pool (line 800) | def _pool(self, x: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]: method forward_intermediates (line 825) | def forward_intermediates( method prune_intermediate_layers (line 892) | def prune_intermediate_layers( method forward (line 907) | def forward(self, x: torch.Tensor): function text_global_pool (line 921) | def text_global_pool( class TextTransformer (line 947) | class TextTransformer(nn.Module): method __init__ (line 950) | def __init__( method init_parameters (line 1034) | def init_parameters(self): method set_grad_checkpointing (line 1058) | def set_grad_checkpointing(self, enable=True): method lock (line 1061) | def lock(self, unlocked_layers: int = 0, freeze_layer_norm: bool = True): method no_weight_decay (line 1073) | def no_weight_decay(self): method build_causal_mask (line 1080) | def build_causal_mask(self): method _build_additive_mask (line 1088) | def _build_additive_mask( method _embeds (line 1112) | def _embeds(self, text) -> Tuple[torch.Tensor, Optional[torch.Tensor]]: method forward_intermediates (line 1137) | def forward_intermediates( method prune_intermediate_layers (line 1207) | def prune_intermediate_layers( method forward (line 1222) | def forward(self, text): class MultimodalTransformer (line 1250) | class MultimodalTransformer(Transformer): method __init__ (line 1251) | def __init__( method init_parameters (line 1294) | def init_parameters(self): method build_attention_mask (line 1312) | def build_attention_mask(self): method forward_intermediates (line 1320) | def forward_intermediates( method forward (line 1329) | def forward(self, image_embs, text_embs): method set_grad_checkpointing (line 1356) | def set_grad_checkpointing(self, enable=True): function lock_text_tower (line 1360) | def lock_text_tower( FILE: src/open_clip/utils.py function freeze_batch_norm_2d (line 11) | def freeze_batch_norm_2d(module, module_match={}, name=''): function _ntuple (line 51) | def _ntuple(n): function replace_linear (line 67) | def replace_linear(model, linear_replacement, include_modules=['c_fc', '... function convert_int8_model_to_inference_mode (line 86) | def convert_int8_model_to_inference_mode(model): function feature_take_indices (line 94) | def feature_take_indices( function _out_indices_as_tuple (line 135) | def _out_indices_as_tuple(x: Union[int, Tuple[int, ...]]) -> Tuple[int, ... FILE: src/open_clip/zero_shot_classifier.py function batched (line 9) | def batched(iterable, n): function build_zero_shot_classifier (line 21) | def build_zero_shot_classifier( function build_zero_shot_classifier_legacy (line 71) | def build_zero_shot_classifier_legacy( FILE: src/open_clip_train/data.py class CsvDataset (line 29) | class CsvDataset(Dataset): method __init__ (line 30) | def __init__(self, input_filename, transforms, img_key, caption_key, s... method __len__ (line 41) | def __len__(self): method __getitem__ (line 44) | def __getitem__(self, idx): class SharedEpoch (line 50) | class SharedEpoch: method __init__ (line 51) | def __init__(self, epoch: int = 0): method set_value (line 54) | def set_value(self, epoch): method get_value (line 57) | def get_value(self): class DataInfo (line 62) | class DataInfo: method set_epoch (line 67) | def set_epoch(self, epoch): function expand_urls (line 74) | def expand_urls(urls, weights=None): function get_dataset_size (line 96) | def get_dataset_size(shards): function get_imagenet (line 118) | def get_imagenet(args, preprocess_fns, split): function count_samples (line 164) | def count_samples(dataloader): function filter_no_caption_or_no_image (line 174) | def filter_no_caption_or_no_image(sample): function log_and_continue (line 180) | def log_and_continue(exn): function group_by_keys_nothrow (line 186) | def group_by_keys_nothrow(data, keys=base_plus_ext, lcase=True, suffixes... function tarfile_to_samples_nothrow (line 214) | def tarfile_to_samples_nothrow(src, handler=log_and_continue): function pytorch_worker_seed (line 222) | def pytorch_worker_seed(increment=0): class detshuffle2 (line 242) | class detshuffle2(wds.PipelineStage): method __init__ (line 243) | def __init__( method run (line 255) | def run(self, src): class ResampledShards2 (line 274) | class ResampledShards2(IterableDataset): method __init__ (line 277) | def __init__( method __iter__ (line 304) | def __iter__(self): function get_wds_dataset (line 328) | def get_wds_dataset(args, preprocess_img, is_train, epoch=0, floor=False... function get_csv_dataset (line 446) | def get_csv_dataset(args, preprocess_fn, is_train, epoch=0, tokenizer=No... class SyntheticDataset (line 476) | class SyntheticDataset(Dataset): method __init__ (line 478) | def __init__( method __len__ (line 494) | def __len__(self): method __getitem__ (line 497) | def __getitem__(self, idx): function get_synthetic_dataset (line 503) | def get_synthetic_dataset(args, preprocess_fn, is_train, epoch=0, tokeni... function get_dataset_fn (line 526) | def get_dataset_fn(data_path, dataset_type): function get_data (line 546) | def get_data(args, preprocess_fns, epoch=0, tokenizer=None): FILE: src/open_clip_train/distributed.py function is_global_master (line 14) | def is_global_master(args): function is_local_master (line 18) | def is_local_master(args): function is_master (line 22) | def is_master(args, local=False): function is_device_available (line 26) | def is_device_available(device): function set_device (line 47) | def set_device(device): function is_using_horovod (line 54) | def is_using_horovod(): function is_using_distributed (line 65) | def is_using_distributed(): function world_info_from_env (line 73) | def world_info_from_env(): function init_distributed_device (line 93) | def init_distributed_device(args): function init_distributed_device_so (line 116) | def init_distributed_device_so( function broadcast_object (line 198) | def broadcast_object(args, obj, src=0): function all_gather_object (line 211) | def all_gather_object(args, obj, dst=0): FILE: src/open_clip_train/file_utils.py function remote_sync_s3 (line 10) | def remote_sync_s3(local_dir, remote_dir): function remote_sync_fsspec (line 20) | def remote_sync_fsspec(local_dir, remote_dir): function remote_sync (line 44) | def remote_sync(local_dir, remote_dir, protocol): function keep_running_remote_sync (line 54) | def keep_running_remote_sync(sync_every, local_dir, remote_dir, protocol): function start_sync_process (line 59) | def start_sync_process(sync_every, local_dir, remote_dir, protocol): function pt_save (line 64) | def pt_save(pt_obj, file_path): function pt_load (line 69) | def pt_load(file_path, map_location=None): function check_exists (line 77) | def check_exists(file_path): FILE: src/open_clip_train/logger.py function setup_logging (line 4) | def setup_logging(log_file, level, include_host=False): FILE: src/open_clip_train/main.py function random_seed (line 44) | def random_seed(seed=42, rank=0): function natural_key (line 50) | def natural_key(string_): function get_latest_checkpoint (line 55) | def get_latest_checkpoint(path: str, remote : bool): function main (line 71) | def main(args): function copy_codebase (line 564) | def copy_codebase(args): FILE: src/open_clip_train/params.py function get_default_params (line 5) | def get_default_params(model_name): class ParseKwargs (line 14) | class ParseKwargs(argparse.Action): method __call__ (line 15) | def __call__(self, parser, namespace, values, option_string=None): function parse_args (line 26) | def parse_args(args): FILE: src/open_clip_train/precision.py function get_autocast (line 6) | def get_autocast(precision, device_type='cuda'): FILE: src/open_clip_train/profiler.py function profile_fvcore (line 26) | def profile_fvcore( function profile_fvcore_text (line 47) | def profile_fvcore_text( function profile_fvcore_image (line 66) | def profile_fvcore_image( function profile_torch_image (line 85) | def profile_torch_image(model, image_input_size, batch_size=1, force_cpu... function profile_torch_text (line 99) | def profile_torch_text(model, text_input_size, batch_size=1, force_cpu=F... function profile_torch (line 113) | def profile_torch(model, text_input_size, image_input_size, batch_size=1... function count_params (line 128) | def count_params(model): function profile_model (line 131) | def profile_model(model_name, batch_size=1, profiler='torch', device="cu... function main (line 211) | def main(): FILE: src/open_clip_train/scheduler.py function assign_learning_rate (line 4) | def assign_learning_rate(optimizer, new_lr): function _warmup_lr (line 9) | def _warmup_lr(base_lr, warmup_length, step): function const_lr (line 13) | def const_lr(optimizer, base_lr, warmup_length, steps): function const_lr_cooldown (line 25) | def const_lr_cooldown(optimizer, base_lr, warmup_length, steps, cooldown... function cosine_lr (line 45) | def cosine_lr(optimizer, base_lr, warmup_length, steps): FILE: src/open_clip_train/train.py class AverageMeter (line 23) | class AverageMeter(object): method __init__ (line 26) | def __init__(self): method reset (line 29) | def reset(self): method update (line 35) | def update(self, val, n=1): function postprocess_clip_output (line 42) | def postprocess_clip_output(model_out): function unwrap_model (line 50) | def unwrap_model(model): function backward (line 57) | def backward(total_loss, scaler): function train_one_epoch (line 64) | def train_one_epoch(model, data, loss, epoch, optimizer, scaler, schedul... function evaluate (line 251) | def evaluate(model, data, epoch, args, tb_writer=None, tokenizer=None): function get_clip_metrics (line 363) | def get_clip_metrics(image_features, text_features, logit_scale): function maybe_compute_generative_loss (line 383) | def maybe_compute_generative_loss(model_out): FILE: src/open_clip_train/zero_shot.py function accuracy (line 11) | def accuracy(output, target, topk=(1,)): function run (line 17) | def run(model, classifier, dataloader, args): function zero_shot_eval (line 45) | def zero_shot_eval(model, data, epoch, args, tokenizer=None): FILE: tests/test_download_pretrained.py class DownloadPretrainedTests (line 18) | class DownloadPretrainedTests(unittest.TestCase): method create_response (line 20) | def create_response(self, data, status_code=200, content_type='applica... method test_download_pretrained_from_url_from_openaipublic (line 30) | def test_download_pretrained_from_url_from_openaipublic(self, urllib): method test_download_pretrained_from_url_from_openaipublic_corrupted (line 40) | def test_download_pretrained_from_url_from_openaipublic_corrupted(self... method test_download_pretrained_from_url_from_openaipublic_valid_cache (line 51) | def test_download_pretrained_from_url_from_openaipublic_valid_cache(se... method test_download_pretrained_from_url_from_openaipublic_corrupted_cache (line 63) | def test_download_pretrained_from_url_from_openaipublic_corrupted_cach... method test_download_pretrained_from_url_from_mlfoundations (line 75) | def test_download_pretrained_from_url_from_mlfoundations(self, urllib): method test_download_pretrained_from_url_from_mlfoundations_corrupted (line 85) | def test_download_pretrained_from_url_from_mlfoundations_corrupted(sel... method test_download_pretrained_from_hfh (line 96) | def test_download_pretrained_from_hfh(self, urllib): FILE: tests/test_hf_model.py function test_poolers (line 9) | def test_poolers(): function test_pretrained_text_encoder (line 22) | def test_pretrained_text_encoder(model_id): FILE: tests/test_inference.py function test_inference_with_data (line 57) | def test_inference_with_data( FILE: tests/test_inference_simple.py function test_inference_simple (line 26) | def test_inference_simple( FILE: tests/test_num_shards.py function test_num_shards (line 18) | def test_num_shards(shards, expected_size): FILE: tests/test_training_simple.py function test_training (line 17) | def test_training(): function test_training_coca (line 33) | def test_training_coca(): function test_training_mt5 (line 49) | def test_training_mt5(): function test_training_unfreezing_vit (line 69) | def test_training_unfreezing_vit(): function test_training_clip_with_jit (line 89) | def test_training_clip_with_jit(): FILE: tests/test_wds.py function build_inputs (line 19) | def build_inputs(test_name): function build_params (line 56) | def build_params(input_shards, seed=0): function get_dataloader (line 73) | def get_dataloader(input_shards): function test_single_source (line 80) | def test_single_source(): function test_two_sources (line 96) | def test_two_sources(): function test_two_sources_same_weights (line 112) | def test_two_sources_same_weights(): function test_two_sources_with_upsampling (line 130) | def test_two_sources_with_upsampling(): FILE: tests/util_test.py function seed_all (line 16) | def seed_all(seed = 0): function inference_text (line 24) | def inference_text(model, model_name, batches): function inference_image (line 33) | def inference_image(model, preprocess_val, batches): function forward_model (line 41) | def forward_model(model, model_name, preprocess_val, image_batch, text_b... function random_image_batch (line 59) | def random_image_batch(batch_size, size): function random_text_batch (line 64) | def random_text_batch(batch_size, min_length = 75, max_length = 75): function create_random_text_data (line 81) | def create_random_text_data( function create_random_image_data (line 95) | def create_random_image_data(path, size, batches = 1, batch_size = 1): function get_data_dirs (line 103) | def get_data_dirs(make_dir = True): function create_test_data_for_model (line 114) | def create_test_data_for_model( function create_test_data (line 176) | def create_test_data( function _sytem_assert (line 200) | def _sytem_assert(string): class TestWrapper (line 203) | class TestWrapper(torch.nn.Module): method __init__ (line 205) | def __init__(self, model, model_name, output_dict=True) -> None: method forward (line 214) | def forward(self, image, text): function main (line 221) | def main(args):