SYMBOL INDEX (1372 symbols across 99 files) FILE: examples/rec_image.py function preprocess (line 11) | def preprocess(video_data: torch.Tensor, short_size: int = 128) -> torch... function main (line 23) | def main(args: argparse.Namespace): FILE: examples/rec_video.py function array_to_video (line 20) | def array_to_video(image_array: npt.NDArray, fps: float = 30.0, output_f... function custom_to_video (line 32) | def custom_to_video(x: torch.Tensor, fps: float = 2.0, output_file: str ... function read_video (line 42) | def read_video(video_path: str, num_frames: int, sample_rate: int) -> to... function preprocess (line 68) | def preprocess(video_data: torch.Tensor, height: int = 128, width: int =... function main (line 83) | def main(args: argparse.Namespace): FILE: opensora/acceleration/communications.py function broadcast (line 10) | def broadcast(input_: torch.Tensor): function _all_to_all (line 16) | def _all_to_all( function _single_all_to_all (line 28) | def _single_all_to_all( class _AllToAll (line 67) | class _AllToAll(torch.autograd.Function): method forward (line 78) | def forward(ctx, input_, scatter_dim, gather_dim, all_to_all_func): method backward (line 86) | def backward(ctx, grad_output): function all_to_all_SBH (line 99) | def all_to_all_SBH( function all_to_all_BSND (line 106) | def all_to_all_BSND( function prepare_parallel_data (line 114) | def prepare_parallel_data( FILE: opensora/acceleration/parallel_states.py class COMM_INFO (line 11) | class COMM_INFO: method __init__ (line 12) | def __init__(self): function initialize_sequence_parallel_state (line 20) | def initialize_sequence_parallel_state(sequence_parallel_size): function set_sequence_parallel_state (line 26) | def set_sequence_parallel_state(state): function get_sequence_parallel_state (line 30) | def get_sequence_parallel_state(): function initialize_sequence_parallel_group (line 33) | def initialize_sequence_parallel_group(sequence_parallel_size): function destroy_sequence_parallel_group (line 55) | def destroy_sequence_parallel_group(): FILE: opensora/adaptor/bf16_optimizer.py function contigous_flatten (line 30) | def contigous_flatten(tensors): class BF16_Optimizer (line 34) | class BF16_Optimizer(ZeROOptimizer): method __init__ (line 36) | def __init__(self, method _setup_for_real_optimizer (line 98) | def _setup_for_real_optimizer(self): method _enable_universal_checkpoint (line 178) | def _enable_universal_checkpoint(self): method _create_param_mapping (line 182) | def _create_param_mapping(self): method _link_all_hp_params (line 194) | def _link_all_hp_params(self): method initialize_optimizer_states (line 212) | def initialize_optimizer_states(self): method _split_flat_tensor (line 233) | def _split_flat_tensor(self, flat_tensor, num_elem_list): method _update_storage_to_flattened_tensor (line 244) | def _update_storage_to_flattened_tensor(self, tensor_list, flat_tensor): method _flatten_dense_tensors_aligned (line 249) | def _flatten_dense_tensors_aligned(self, tensor_list, alignment): method step (line 253) | def step(self, closure=None): method backward (line 277) | def backward(self, loss, update_hp_grads=True, clear_lp_grads=False, *... method update_hp_grads (line 293) | def update_hp_grads(self, clear_lp_grads=False): method get_grads_for_reduction (line 322) | def get_grads_for_reduction(self): method get_grads_for_norm (line 326) | def get_grads_for_norm(self, for_clipping=False): method update_lp_params (line 346) | def update_lp_params(self): method clear_hp_grads (line 361) | def clear_hp_grads(self): method clear_lp_grads (line 368) | def clear_lp_grads(self): method state_dict (line 375) | def state_dict(self): method _restore_from_bit16_weights (line 388) | def _restore_from_bit16_weights(self): method refresh_fp32_params (line 394) | def refresh_fp32_params(self): method load_state_dict (line 397) | def load_state_dict(self, method _load_legacy_checkpoint (line 408) | def _load_legacy_checkpoint(self, state_dict_list, load_optimizer_stat... method _load_universal_checkpoint (line 431) | def _load_universal_checkpoint(self, checkpoint_folder, load_optimizer... method param_groups (line 435) | def param_groups(self): method _load_hp_checkpoint_state (line 439) | def _load_hp_checkpoint_state(self, checkpoint_dir): function _get_padded_tensor (line 452) | def _get_padded_tensor(src_tensor, size): FILE: opensora/adaptor/engine.py function split_half_float_double_sparse (line 123) | def split_half_float_double_sparse(tensors): class EngineTimers (line 142) | class EngineTimers(object): method __init__ (line 145) | def __init__(self, enable_micro_timers, enable_global_timers): class DeepSpeedEngine (line 177) | class DeepSpeedEngine(Module): method __init__ (line 180) | def __init__( method destroy (line 365) | def destroy(self): method _get_model_parameters (line 369) | def _get_model_parameters(self): method get_batch_info (line 391) | def get_batch_info(self): method set_train_batch_size (line 407) | def set_train_batch_size(self, train_batch_size): method set_train_micro_batch_size (line 425) | def set_train_micro_batch_size(self, micro_batch_size): method set_data_post_process_func (line 436) | def set_data_post_process_func(self, post_process_func): method set_custom_curriculum_learning_schedule (line 440) | def set_custom_curriculum_learning_schedule(self, schedule_func_dict): method get_global_grad_norm (line 444) | def get_global_grad_norm(self) -> float: method __getattr__ (line 456) | def __getattr__(self, name): method checkpoint_tag_validation_enabled (line 471) | def checkpoint_tag_validation_enabled(self): method checkpoint_tag_validation_fail (line 474) | def checkpoint_tag_validation_fail(self): method elasticity_enabled (line 477) | def elasticity_enabled(self): method is_elastic_model_parallel_supported (line 480) | def is_elastic_model_parallel_supported(self): method pld_enabled (line 488) | def pld_enabled(self): method pld_params (line 491) | def pld_params(self): method pld_theta (line 494) | def pld_theta(self): method pld_gamma (line 497) | def pld_gamma(self): method eigenvalue_enabled (line 500) | def eigenvalue_enabled(self): method eigenvalue_verbose (line 503) | def eigenvalue_verbose(self): method eigenvalue_max_iter (line 506) | def eigenvalue_max_iter(self): method eigenvalue_tol (line 509) | def eigenvalue_tol(self): method eigenvalue_stability (line 512) | def eigenvalue_stability(self): method eigenvalue_gas_boundary_resolution (line 515) | def eigenvalue_gas_boundary_resolution(self): method eigenvalue_layer_name (line 518) | def eigenvalue_layer_name(self): method eigenvalue_layer_num (line 521) | def eigenvalue_layer_num(self): method curriculum_enabled_legacy (line 524) | def curriculum_enabled_legacy(self): method curriculum_params_legacy (line 527) | def curriculum_params_legacy(self): method data_efficiency_enabled (line 530) | def data_efficiency_enabled(self): method data_efficiency_config (line 533) | def data_efficiency_config(self): method data_sampling_enabled (line 536) | def data_sampling_enabled(self): method data_sampling_config (line 539) | def data_sampling_config(self): method curriculum_learning_enabled (line 542) | def curriculum_learning_enabled(self): method curriculum_learning_config (line 545) | def curriculum_learning_config(self): method random_ltd_enabled (line 548) | def random_ltd_enabled(self): method random_ltd_config (line 551) | def random_ltd_config(self): method random_ltd_initialize (line 554) | def random_ltd_initialize(self): method wall_clock_breakdown (line 575) | def wall_clock_breakdown(self): method flops_profiler_enabled (line 578) | def flops_profiler_enabled(self): method flops_profiler_recompute_fwd_factor (line 581) | def flops_profiler_recompute_fwd_factor(self): method flops_profiler_profile_step (line 584) | def flops_profiler_profile_step(self): method flops_profiler_module_depth (line 590) | def flops_profiler_module_depth(self): method flops_profiler_top_modules (line 593) | def flops_profiler_top_modules(self): method flops_profiler_detailed (line 596) | def flops_profiler_detailed(self): method flops_profiler_output_file (line 601) | def flops_profiler_output_file(self): method memory_breakdown (line 604) | def memory_breakdown(self): method autotuning_enabled (line 607) | def autotuning_enabled(self): method autotuning_start_profile_step (line 610) | def autotuning_start_profile_step(self): method autotuning_end_profile_step (line 613) | def autotuning_end_profile_step(self): method autotuning_metric_path (line 616) | def autotuning_metric_path(self): method autotuning_model_info_path (line 622) | def autotuning_model_info_path(self): method autotuning_metric (line 628) | def autotuning_metric(self): method autotuning_profile_model_info (line 631) | def autotuning_profile_model_info(self): method sparse_gradients_enabled (line 636) | def sparse_gradients_enabled(self): method train_batch_size (line 639) | def train_batch_size(self): method train_micro_batch_size_per_gpu (line 642) | def train_micro_batch_size_per_gpu(self): method optimizer_name (line 645) | def optimizer_name(self): method optimizer_params (line 648) | def optimizer_params(self): method optimizer_legacy_fusion (line 651) | def optimizer_legacy_fusion(self): method scheduler_name (line 654) | def scheduler_name(self): method scheduler_params (line 657) | def scheduler_params(self): method quantize_training (line 660) | def quantize_training(self): method zero_optimization (line 675) | def zero_optimization(self): method zero_allow_untested_optimizer (line 678) | def zero_allow_untested_optimizer(self): method zero_force_ds_cpu_optimizer (line 681) | def zero_force_ds_cpu_optimizer(self): method zero_reduce_scatter (line 684) | def zero_reduce_scatter(self): method zero_overlap_comm (line 687) | def zero_overlap_comm(self): method zero_offload_optimizer (line 690) | def zero_offload_optimizer(self): method zero_offload_param (line 693) | def zero_offload_param(self): method zero_use_cpu_optimizer (line 696) | def zero_use_cpu_optimizer(self): method zero_cpu_offload (line 701) | def zero_cpu_offload(self): method zero_partial_offload (line 706) | def zero_partial_offload(self): method zero_sub_group_size (line 709) | def zero_sub_group_size(self): method zero_optimization_stage (line 712) | def zero_optimization_stage(self): method mics_shard_size (line 715) | def mics_shard_size(self): method zero_reduce_bucket_size (line 718) | def zero_reduce_bucket_size(self): method zero_multi_rank_bucket_allreduce (line 721) | def zero_multi_rank_bucket_allreduce(self): method zero_allgather_bucket_size (line 724) | def zero_allgather_bucket_size(self): method zero_optimization_partition_gradients (line 727) | def zero_optimization_partition_gradients(self): method zero_optimization_partition_weights (line 730) | def zero_optimization_partition_weights(self): method is_first_weights_partition_group (line 733) | def is_first_weights_partition_group(self): method zero_contiguous_gradients (line 740) | def zero_contiguous_gradients(self): method zero_load_from_fp32_weights (line 743) | def zero_load_from_fp32_weights(self): method zero_elastic_checkpoint (line 746) | def zero_elastic_checkpoint(self): method zero_max_live_parameters (line 749) | def zero_max_live_parameters(self): method zero_max_reuse_distance (line 752) | def zero_max_reuse_distance(self): method zero_prefetch_bucket_size (line 755) | def zero_prefetch_bucket_size(self): method zero_param_persistence_threshold (line 758) | def zero_param_persistence_threshold(self): method zero_model_persistence_threshold (line 761) | def zero_model_persistence_threshold(self): method zero_gather_16bit_weights_on_model_save (line 764) | def zero_gather_16bit_weights_on_model_save(self): method zero_grad_hooks (line 767) | def zero_grad_hooks(self): method zero_legacy_stage1 (line 770) | def zero_legacy_stage1(self): method zero_ignore_unused_parameters (line 773) | def zero_ignore_unused_parameters(self): method graph_harvesting (line 776) | def graph_harvesting(self): method fp16_enabled (line 779) | def fp16_enabled(self): method bfloat16_enabled (line 782) | def bfloat16_enabled(self): method fp16_master_weights_and_gradients (line 785) | def fp16_master_weights_and_gradients(self): method amp_enabled (line 788) | def amp_enabled(self): method amp_params (line 791) | def amp_params(self): method fp16_auto_cast (line 794) | def fp16_auto_cast(self): method loss_scale (line 797) | def loss_scale(self): method gradient_accumulation_steps (line 800) | def gradient_accumulation_steps(self): method use_node_local_storage (line 803) | def use_node_local_storage(self): method load_universal_checkpoint (line 806) | def load_universal_checkpoint(self): method communication_data_type (line 810) | def communication_data_type(self): method communication_data_type (line 824) | def communication_data_type(self, value): method postscale_gradients (line 827) | def postscale_gradients(self): method gradient_predivide_factor (line 830) | def gradient_predivide_factor(self): method steps_per_print (line 833) | def steps_per_print(self): method zero_allgather_partitions (line 836) | def zero_allgather_partitions(self): method zero_round_robin_gradients (line 839) | def zero_round_robin_gradients(self): method zero_hpz_partition_size (line 842) | def zero_hpz_partition_size(self): method zero_quantized_weights (line 845) | def zero_quantized_weights(self): method zero_quantized_nontrainable_weights (line 848) | def zero_quantized_nontrainable_weights(self): method zero_quantized_gradients (line 851) | def zero_quantized_gradients(self): method dump_state (line 854) | def dump_state(self): method gradient_clipping (line 857) | def gradient_clipping(self): method dynamic_loss_scale (line 860) | def dynamic_loss_scale(self): method initial_dynamic_scale (line 863) | def initial_dynamic_scale(self): method dynamic_loss_scale_args (line 866) | def dynamic_loss_scale_args(self): method swap_tensor_config (line 869) | def swap_tensor_config(self): method aio_config (line 872) | def aio_config(self): method get_data_types (line 875) | def get_data_types(self): method _optimizer_has_ckpt_event_prologue (line 892) | def _optimizer_has_ckpt_event_prologue(self): method _optimizer_has_ckpt_event_epilogue (line 895) | def _optimizer_has_ckpt_event_epilogue(self): method _configure_lr_scheduler (line 898) | def _configure_lr_scheduler(self, client_lr_scheduler): method _configure_checkpointing (line 914) | def _configure_checkpointing(self, dist_init_required): method _scheduler_from_config (line 943) | def _scheduler_from_config(self, optimizer): method _set_distributed_vars (line 960) | def _set_distributed_vars(self, args): method _configure_with_arguments (line 973) | def _configure_with_arguments(self, args, mpu): method _do_args_sanity_check (line 991) | def _do_args_sanity_check(self, args): method _is_supported_optimizer (line 1005) | def _is_supported_optimizer(self, optimizer_name): method _supported_optims (line 1008) | def _supported_optims(self): method _do_sanity_check (line 1022) | def _do_sanity_check(self): method _broadcast_model (line 1042) | def _broadcast_model(self): method __check_params (line 1061) | def __check_params(model: Module, dtype: torch.dtype) -> None: method _set_client_model (line 1068) | def _set_client_model(self, model): method _configure_distributed_model (line 1075) | def _configure_distributed_model(self, model): method _check_for_duplicates (line 1142) | def _check_for_duplicates(self, optimizer): method _do_optimizer_sanity_check (line 1155) | def _do_optimizer_sanity_check(self, basic_optimizer): method _configure_optimizer (line 1210) | def _configure_optimizer(self, client_optimizer, model_parameters): method _configure_basic_optimizer (line 1258) | def _configure_basic_optimizer(self, model_parameters): method _configure_compression_scheduler (line 1356) | def _configure_compression_scheduler(self): method _configure_random_ltd_scheduler (line 1359) | def _configure_random_ltd_scheduler(self, configs): method _configure_quantization (line 1362) | def _configure_quantization(self): method _configure_fp16_optimizer (line 1394) | def _configure_fp16_optimizer(self, optimizer): method _configure_bf16_optimizer (line 1445) | def _configure_bf16_optimizer(self, optimizer): method _configure_zero_optimizer (line 1466) | def _configure_zero_optimizer(self, optimizer): method _return_mics_optimizer (line 1608) | def _return_mics_optimizer(self, basic_optimizer, timers): method _configure_eigenvalue (line 1641) | def _configure_eigenvalue(self): method _configure_progressive_layer_drop (line 1654) | def _configure_progressive_layer_drop(self): method _configure_curriculum_scheduler_legacy (line 1659) | def _configure_curriculum_scheduler_legacy(self): method is_map_style_dataset (line 1664) | def is_map_style_dataset(obj): method is_iterable_style_dataset (line 1668) | def is_iterable_style_dataset(obj): method dataloader_drop_last (line 1671) | def dataloader_drop_last(self): method was_step_applied (line 1674) | def was_step_applied(self) -> bool: method deepspeed_io (line 1684) | def deepspeed_io(self, method train (line 1745) | def train(self, mode=True): method eval (line 1751) | def eval(self): method _scale_loss_by_gas (line 1757) | def _scale_loss_by_gas(self, prescaled_loss): method forward (line 1776) | def forward(self, *inputs, **kwargs): method _cast_inputs_half (line 1861) | def _cast_inputs_half(self, inputs): method print_forward_breakdown (line 1877) | def print_forward_breakdown(self, fwd_time): method allreduce_gradients (line 1901) | def allreduce_gradients(self, bucket_size=MEMORY_OPT_ALLREDUCE_SIZE): method backward (line 1920) | def backward(self, loss, allreduce_gradients=True, release_loss=False,... method is_gradient_accumulation_boundary (line 2002) | def is_gradient_accumulation_boundary(self): method set_gradient_accumulation_boundary (line 2018) | def set_gradient_accumulation_boundary(self, is_boundary): method zero_grad (line 2042) | def zero_grad(self): method clip_fp32_gradients (line 2049) | def clip_fp32_gradients(self): method _take_model_step (line 2052) | def _take_model_step(self, lr_kwargs, block_eigenvalue={}): method step (line 2118) | def step(self, lr_kwargs=None): method _start_timers (line 2224) | def _start_timers(self, timer_names): method _stop_timers (line 2228) | def _stop_timers(self, timer_names): method _autotuning_exit (line 2235) | def _autotuning_exit(self): method _write_monitor (line 2259) | def _write_monitor(self): method _get_optimizer_param (line 2290) | def _get_optimizer_param(self, param_name): method get_lr (line 2301) | def get_lr(self): method get_type (line 2304) | def get_type(self): method get_mom (line 2307) | def get_mom(self): method get_pld_theta (line 2313) | def get_pld_theta(self): method _report_progress (line 2319) | def _report_progress(self, step): method allreduce_bucket (line 2324) | def allreduce_bucket(self, bucket, dp_group): method allreduce_and_copy (line 2349) | def allreduce_and_copy(self, small_bucket, dp_group): method allreduce_no_retain (line 2354) | def allreduce_no_retain(self, bucket, dp_group, numel_per_bucket=50000... method _get_gradients_for_reduction (line 2367) | def _get_gradients_for_reduction(self): method _reduce_non_expert_gradients (line 2398) | def _reduce_non_expert_gradients(self, grads, elements_per_buffer): method _reduce_expert_gradients (line 2413) | def _reduce_expert_gradients(self, expert_grads, elements_per_buffer): method buffered_allreduce_fallback (line 2426) | def buffered_allreduce_fallback(self, grads=None, elements_per_buffer=... method sparse_allreduce_no_retain (line 2438) | def sparse_allreduce_no_retain(self, bucket, dp_group): method sparse_allreduce_bucket (line 2447) | def sparse_allreduce_bucket(self, bucket, dp_group): method sparse_allreduce (line 2453) | def sparse_allreduce(self, sparse, dp_group): method sparse_all_gather (line 2479) | def sparse_all_gather(self, value, dp_group): method all_gather_scalar (line 2506) | def all_gather_scalar(self, value, dp_group): method module_state_dict (line 2511) | def module_state_dict(self, destination=None, prefix="", keep_vars=Fal... method load_moe_state_dict (line 2525) | def load_moe_state_dict(checkpoint_path, method load_module_state_dict (line 2580) | def load_module_state_dict(self, checkpoint, strict=True, custom_load_... method _get_zero_ckpt_prefix (line 2611) | def _get_zero_ckpt_prefix(self, dp_rank, bf16_mode): method _get_rank_zero_ckpt_name (line 2614) | def _get_rank_zero_ckpt_name(self, checkpoints_path, tag, mp_rank, dp_... method _get_zero_ckpt_name (line 2623) | def _get_zero_ckpt_name(self, checkpoints_path, tag): method _get_ckpt_name (line 2629) | def _get_ckpt_name(self, checkpoints_path, tag, mp_placeholder=None): method _get_optimizer_ckpt_name (line 2651) | def _get_optimizer_ckpt_name(self, checkpoints_path, tag, expp_rank): method _get_expert_ckpt_name (line 2658) | def _get_expert_ckpt_name(checkpoints_path, layer_id, expert_id, tag, ... method _get_all_ckpt_names (line 2670) | def _get_all_ckpt_names(self, checkpoints_path, tag): method load_checkpoint (line 2679) | def load_checkpoint(self, method _load_checkpoint (line 2756) | def _load_checkpoint(self, method _load_zero_checkpoint (line 2895) | def _load_zero_checkpoint(self, load_dir, tag, load_optimizer_states=T... method update_optimizer_step (line 2933) | def update_optimizer_step(self, step): method _get_mp_rank_zero_checkpoint_names (line 2951) | def _get_mp_rank_zero_checkpoint_names(self, load_dir, tag, mp_rank, d... method _get_all_zero_checkpoint_names (line 2963) | def _get_all_zero_checkpoint_names(self, load_dir, tag, bf16_mode): method _get_all_zero_checkpoint_state_dicts (line 2981) | def _get_all_zero_checkpoint_state_dicts(self, zero_ckpt_names): method _get_all_zero_checkpoints (line 3001) | def _get_all_zero_checkpoints(self, load_dir, tag): method _checkpoint_tag_validation (line 3014) | def _checkpoint_tag_validation(self, tag): method save_checkpoint (line 3031) | def save_checkpoint(self, save_dir, tag=None, client_state={}, save_la... method _get_non_moe_state_dict (line 3107) | def _get_non_moe_state_dict(self, full_state_dict): method _save_moe_checkpoint (line 3117) | def _save_moe_checkpoint(self, save_dir, tag, client_state={}, exclude... method _create_checkpoint_file (line 3228) | def _create_checkpoint_file(self, save_dir, tag, zero_checkpoint): method _create_zero_checkpoint_files (line 3240) | def _create_zero_checkpoint_files(self, save_dir, tag): method _save_checkpoint (line 3251) | def _save_checkpoint(self, save_dir, tag, client_state={}, exclude_fro... method _get_buffer_names (line 3294) | def _get_buffer_names(self): method _get_param_shape_func (line 3315) | def _get_param_shape_func(self, param): method _get_param_fragment_func (line 3318) | def _get_param_fragment_func(self, param): method _get_zero_frozen_param_attributes (line 3321) | def _get_zero_frozen_param_attributes(self, attr_func): method _get_zero_param_shapes (line 3334) | def _get_zero_param_shapes(self): method _get_shared_params (line 3376) | def _get_shared_params(self): method _copy_recovery_script (line 3416) | def _copy_recovery_script(self, save_path): method _change_recovery_script_permissions (line 3425) | def _change_recovery_script_permissions(self, dst): method _save_zero_checkpoint (line 3435) | def _save_zero_checkpoint(self, save_path, tag): method _zero3_consolidated_16bit_state_dict (line 3445) | def _zero3_consolidated_16bit_state_dict(self): method save_fp16_model (line 3509) | def save_fp16_model(self, save_dir, save_filename="pytorch_model.bin"): method save_16bit_model (line 3514) | def save_16bit_model(self, save_dir, save_filename="pytorch_model.bin"): method empty_partition_cache (line 3561) | def empty_partition_cache(self): FILE: opensora/adaptor/modules.py function fp32_layer_norm_forward (line 6) | def fp32_layer_norm_forward(self, inputs: torch.Tensor) -> torch.Tensor: function fp32_silu_forward (line 12) | def fp32_silu_forward(self, inputs: torch.Tensor) -> torch.Tensor: function fp32_gelu_forward (line 16) | def fp32_gelu_forward(self, inputs: torch.Tensor) -> torch.Tensor: function replace_with_fp32_forwards (line 20) | def replace_with_fp32_forwards(): FILE: opensora/adaptor/stage_1_and_2.py function input (line 49) | def input(msg): function split_half_float_double (line 53) | def split_half_float_double(tensors): function isclose (line 67) | def isclose(a, b, rtol=1e-09, atol=0.0): function lcm (line 71) | def lcm(x, y): function get_alignment_padding (line 76) | def get_alignment_padding(tensor_list, alignment): function move_to_cpu (line 82) | def move_to_cpu(tensor_list): function print_rank_msg (line 87) | def print_rank_msg(msg): function _get_padded_tensor (line 91) | def _get_padded_tensor(src_tensor, size): function contigous_flatten (line 100) | def contigous_flatten(tensors): function all_gather_into_tensor_dp_groups (line 104) | def all_gather_into_tensor_dp_groups(groups_flat, partitioned_param_grou... class DeepSpeedZeroOptimizer (line 121) | class DeepSpeedZeroOptimizer(ZeROOptimizer): method __init__ (line 133) | def __init__(self, method _enable_universal_checkpoint (line 561) | def _enable_universal_checkpoint(self): method _create_param_mapping (line 565) | def _create_param_mapping(self): method _link_all_hp_params (line 577) | def _link_all_hp_params(self): method is_moe_group (line 598) | def is_moe_group(self, group): method _configure_moe_settings (line 601) | def _configure_moe_settings(self): method _update_model_bit16_weights (line 628) | def _update_model_bit16_weights(self, group_index): method _round_robin_reorder (line 639) | def _round_robin_reorder(self, tensor_list, num_partitions): method _release_ipg_buffers (line 662) | def _release_ipg_buffers(self): method initialize_optimizer_states (line 668) | def initialize_optimizer_states(self): method reduce_gradients (line 694) | def reduce_gradients(self, pipeline_parallel=False): method get_first_param_index (line 720) | def get_first_param_index(self, group_id, param_group, partition_id): method initialize_gradient_partitioning_data_structures (line 727) | def initialize_gradient_partitioning_data_structures(self): method independent_gradient_partition_epilogue (line 751) | def independent_gradient_partition_epilogue(self): method reset_partition_gradient_structures (line 799) | def reset_partition_gradient_structures(self): method initialize_gradient_partition (line 809) | def initialize_gradient_partition(self, i, param_group, partition_id): method overlapping_partition_gradients_reduce_epilogue (line 860) | def overlapping_partition_gradients_reduce_epilogue(self): method fill_grad_accum_attribute (line 863) | def fill_grad_accum_attribute(self): method get_gradient_for_reduction (line 874) | def get_gradient_for_reduction(self, param): method get_param_gradient_attribute (line 880) | def get_param_gradient_attribute(self, param): method clear_grad_attribute (line 884) | def clear_grad_attribute(self, param): method create_reduce_and_remove_grad_hooks (line 890) | def create_reduce_and_remove_grad_hooks(self): method get_param_id (line 907) | def get_param_id(self, param): method report_ipg_memory_usage (line 911) | def report_ipg_memory_usage(self, tag, param_elems): method flatten_dense_tensors_aligned (line 919) | def flatten_dense_tensors_aligned(self, tensor_list, alignment): method reduce_independent_p_g_buckets_and_remove_grads (line 923) | def reduce_independent_p_g_buckets_and_remove_grads(self, param, i): method print_rank_0 (line 962) | def print_rank_0(self, message): method gradient_reduction_w_predivide (line 966) | def gradient_reduction_w_predivide(self, tensor): method allreduce_and_copy_with_multiple_ranks (line 993) | def allreduce_and_copy_with_multiple_ranks(self, method allreduce_and_scatter (line 1005) | def allreduce_and_scatter(self, bucket, numel_per_bucket=500000000, lo... method average_tensor (line 1033) | def average_tensor(self, tensor): method get_grad_position (line 1138) | def get_grad_position(self, group_id, tensor_list, first_offset, parti... method update_overflow_tracker_for_param_grad (line 1163) | def update_overflow_tracker_for_param_grad(self, param): method _get_offload_gradient_dict (line 1168) | def _get_offload_gradient_dict(self): method async_accumulate_grad_in_cpu_via_gpu (line 1178) | def async_accumulate_grad_in_cpu_via_gpu(self, param): method set_norm_for_param_grad (line 1227) | def set_norm_for_param_grad(self, param): method set_norm_for_param_grad_in_gpu (line 1240) | def set_norm_for_param_grad_in_gpu(self, param): method async_inplace_copy_grad_to_fp32_buffer_from_gpu (line 1255) | def async_inplace_copy_grad_to_fp32_buffer_from_gpu(self, param): method complete_grad_norm_calculation_for_cpu_offload (line 1273) | def complete_grad_norm_calculation_for_cpu_offload(self, params): method copy_grads_in_partition (line 1316) | def copy_grads_in_partition(self, param): method reduce_ipg_grads (line 1352) | def reduce_ipg_grads(self): method reduce_ready_partitions_and_remove_grads (line 1410) | def reduce_ready_partitions_and_remove_grads(self, param, i): method zero_reduced_gradients (line 1414) | def zero_reduced_gradients(self, partition_id, i): method flatten_and_print (line 1426) | def flatten_and_print(self, message, tensors, start=0, n=5): method get_grads_to_reduce (line 1434) | def get_grads_to_reduce(self, i, partition_id): method sequential_execution (line 1459) | def sequential_execution(self, function, message, group=None): method set_none_gradients_to_zero (line 1469) | def set_none_gradients_to_zero(self, i, partition_id): method allreduce_bucket (line 1476) | def allreduce_bucket(self, bucket, rank=None, log=None, divide=True, p... method _clear_previous_reduced_grads (line 1510) | def _clear_previous_reduced_grads(self): method allreduce_and_copy (line 1517) | def allreduce_and_copy(self, small_bucket, rank=None, log=None, divide... method allreduce_no_retain (line 1539) | def allreduce_no_retain( method buffered_reduce_fallback (line 1563) | def buffered_reduce_fallback(self, rank, grads, elements_per_buffer=50... method get_data_parallel_partitions (line 1575) | def get_data_parallel_partitions(self, tensor, group_id): method get_partition_info (line 1595) | def get_partition_info(self, tensor_list, partition_size, partition_id): method zero_grad (line 1626) | def zero_grad(self, set_to_none=True): method _model_parallel_all_reduce (line 1643) | def _model_parallel_all_reduce(self, tensor, op): method get_grad_norm_direct (line 1651) | def get_grad_norm_direct(self, gradients, params, norm_type=2): method get_flat_partition (line 1704) | def get_flat_partition(self, tensor_list, first_offset, partition_size... method free_grad_in_param_list (line 1744) | def free_grad_in_param_list(self, param_list): method reset_cpu_buffers (line 1749) | def reset_cpu_buffers(self): method set_lr (line 1753) | def set_lr(self, lr): method get_lr (line 1758) | def get_lr(self): method override_loss_scale (line 1762) | def override_loss_scale(self, loss_scale): method scaled_global_norm (line 1768) | def scaled_global_norm(self, norm_type=2): method get_bit16_param_group (line 1785) | def get_bit16_param_group(self, group_no): method _optimizer_step (line 1790) | def _optimizer_step(self, group_no): method step (line 1802) | def step(self, closure=None): method update_lp_params (line 1924) | def update_lp_params(self): method _average_expert_grad_norms (line 1936) | def _average_expert_grad_norms(self, norm_groups): method unscale_and_clip_grads (line 1946) | def unscale_and_clip_grads(self, grad_groups_flat, total_norm): method _check_overflow (line 1963) | def _check_overflow(self, partition_gradients=True): method has_overflow_serial (line 1967) | def has_overflow_serial(self, params, is_grad_list=False): method has_overflow_partitioned_grads_serial (line 1974) | def has_overflow_partitioned_grads_serial(self): method has_overflow (line 1981) | def has_overflow(self, partition_gradients=True): method _has_inf_or_nan (line 2007) | def _has_inf_or_nan(x, j=None): method backward (line 2027) | def backward(self, loss, retain_graph=False): method check_overflow (line 2062) | def check_overflow(self, partition_gradients=True): method _update_scale (line 2065) | def _update_scale(self, has_overflow=False): method _get_state (line 2069) | def _get_state(self): method _set_state (line 2072) | def _set_state(self, value): method _get_param_groups (line 2079) | def _get_param_groups(self): method _set_param_groups (line 2082) | def _set_param_groups(self, value): method _get_loss_scale (line 2088) | def _get_loss_scale(self): method _set_loss_scale (line 2094) | def _set_loss_scale(self, value): method _get_groups_without_padding (line 2102) | def _get_groups_without_padding(self, groups_with_padding): method _get_state_without_padding (line 2111) | def _get_state_without_padding(self, state_with_padding, padding): method _get_base_optimizer_state (line 2124) | def _get_base_optimizer_state(self): method state_dict (line 2133) | def state_dict(self): method _restore_from_elastic_fp32_weights (line 2179) | def _restore_from_elastic_fp32_weights(self, all_state_dict): method _restore_from_bit16_weights (line 2198) | def _restore_from_bit16_weights(self): method refresh_fp32_params (line 2205) | def refresh_fp32_params(self): method _partition_base_optimizer_state (line 2209) | def _partition_base_optimizer_state(self, state_key, all_partition_sta... method _restore_base_optimizer_state (line 2220) | def _restore_base_optimizer_state(self, base_optimizer_group_states): method get_ep_ranks (line 2233) | def get_ep_ranks(self, rank=0, group_name=None): method _restore_elastic_base_optimizer_state (line 2245) | def _restore_elastic_base_optimizer_state(self, all_state_dict): method load_state_dict (line 2270) | def load_state_dict(self, method _load_universal_checkpoint (line 2281) | def _load_universal_checkpoint(self, checkpoint_folder, load_optimizer... method param_groups (line 2285) | def param_groups(self): method _load_hp_checkpoint_state (line 2289) | def _load_hp_checkpoint_state(self, checkpoint_dir): method _load_global_state (line 2308) | def _load_global_state(self, sd): method _load_legacy_checkpoint (line 2326) | def _load_legacy_checkpoint(self, state_dict_list, load_optimizer_stat... function _handle_overflow (line 2415) | def _handle_overflow(cpu_sum, x, i): function estimate_zero2_model_states_mem_needs (line 2427) | def estimate_zero2_model_states_mem_needs(total_params, function model_to_params (line 2444) | def model_to_params(model): function estimate_zero2_model_states_mem_needs_all_live (line 2450) | def estimate_zero2_model_states_mem_needs_all_live(model, function estimate_zero2_model_states_mem_needs_all_cold (line 2480) | def estimate_zero2_model_states_mem_needs_all_cold(total_params, FILE: opensora/adaptor/utils.py class DummyOptim (line 39) | class DummyOptim(): method __init__ (line 45) | def __init__(self, params): function graph_process (line 53) | def graph_process(replay_first_step, func, *args, **kwargs): function noop_decorator (line 71) | def noop_decorator(func): class noop_context (line 75) | class noop_context(object): method __init__ (line 77) | def __init__(self): method __enter__ (line 80) | def __enter__(self): method __exit__ (line 83) | def __exit__(self, exc_type, exc_val, exc_tb): function ensure_directory_exists (line 87) | def ensure_directory_exists(filename): function set_random_seed (line 97) | def set_random_seed(seed): function is_model_parallel_parameter (line 110) | def is_model_parallel_parameter(p) -> bool: function bwc_tensor_model_parallel_rank (line 120) | def bwc_tensor_model_parallel_rank(mpu=None): function copy_to_device (line 158) | def copy_to_device(item, device, criterion_func): function move_to_device (line 182) | def move_to_device(item, device, criterion_func): class CheckOverflow (line 208) | class CheckOverflow(object): method __init__ (line 211) | def __init__(self, param_groups=None, mpu=None, zero_reduce_scatter=Fa... method check_using_norm (line 224) | def check_using_norm(self, norm_group, reduce_overflow=True): method check (line 243) | def check(self, param_groups=None): method has_overflow_serial (line 262) | def has_overflow_serial(self, params): method has_overflow (line 268) | def has_overflow(self, params, has_moe_params=None): method _has_inf_or_nan (line 299) | def _has_inf_or_nan(x, i): function _handle_overflow (line 320) | def _handle_overflow(cpu_sum, x, i): function get_global_norm (line 332) | def get_global_norm(norm_list): function clip_grad_norm_ (line 342) | def clip_grad_norm_(parameters, max_norm, norm_type=2, mpu=None): function get_grad_norm (line 407) | def get_grad_norm(parameters, norm_type=2, mpu=None): function get_grad_zeros (line 463) | def get_grad_zeros(parameters, mpu=None): function get_weight_norm (line 503) | def get_weight_norm(parameters, norm_type=2, mpu=None): function prefix_sum_inc (line 559) | def prefix_sum_inc(weights): function partition_uniform (line 572) | def partition_uniform(num_items, num_parts): function partition_balanced (line 593) | def partition_balanced(weights, num_parts): class PartitionedTensor (line 634) | class PartitionedTensor: method __init__ (line 636) | def __init__(self, tensor, group, partition_meta=None): method from_meta (line 648) | def from_meta(cls, meta, local_part, group, device=get_accelerator().d... method _partition_tensor (line 673) | def _partition_tensor(self, tensor): method full (line 681) | def full(self, device=None): method to_meta (line 700) | def to_meta(self): method data (line 717) | def data(self): method local_size (line 720) | def local_size(self): method full_size (line 723) | def full_size(self): function memory_status (line 731) | def memory_status(msg, print_rank=-1, reset_max=False): function get_ma_status (line 770) | def get_ma_status(): function empty_cache (line 776) | def empty_cache(): function see_memory_usage (line 781) | def see_memory_usage(message, force=False): function call_to_str (line 805) | def call_to_str(base, *args, **kwargs): function get_only_unique_item (line 827) | def get_only_unique_item(items): function clip_gradients (line 836) | def clip_gradients(parameters, max_norm=1.0, global_grad_norm=None, mpu=... function get_global_norm_of_tensors (line 855) | def get_global_norm_of_tensors(input_tensors, norm_type=2, mpu=None, use... function clip_tensors_by_global_norm (line 908) | def clip_tensors_by_global_norm(input_tensors, max_norm=1.0, global_norm... function align_dense_tensors (line 942) | def align_dense_tensors(tensor_list, alignment): function all_gather_into_tensor_dp_groups (line 956) | def all_gather_into_tensor_dp_groups(groups_flat, partitioned_param_grou... function all_gather_dp_groups (line 969) | def all_gather_dp_groups(groups_flat, partitioned_param_groups, zp_proce... class TLinear (line 1006) | class TLinear(torch.nn.Linear): method __init__ (line 1008) | def __init__(self, orig_layer, name=""): method _fwd (line 1015) | def _fwd(self, input): method _fwd_bias_add (line 1018) | def _fwd_bias_add(self, input): method forward (line 1021) | def forward(self, input): function get_inactive_params (line 1025) | def get_inactive_params(param_list): function required_torch_version (line 1031) | def required_torch_version(min_version=None, max_version=None): FILE: opensora/adaptor/zp_manager.py class ZPManager (line 6) | class ZPManager(object): method __init__ (line 7) | def __init__(self, zp_size=8): method init_group (line 15) | def init_group(self): FILE: opensora/dataset/__init__.py function getdataset (line 19) | def getdataset(args): FILE: opensora/dataset/inpaint_dataset.py function type_ratio_normalize (line 44) | def type_ratio_normalize(mask_type_ratio_dict): class Inpaint_dataset (line 53) | class Inpaint_dataset(T2V_dataset): method __init__ (line 54) | def __init__(self, args, resize_transform, transform, temporal_sample,... method __getitem__ (line 86) | def __getitem__(self, idx): method get_data (line 100) | def get_data(self, idx): method drop (line 111) | def drop(self, text, is_video=True): method get_video (line 126) | def get_video(self, idx): method get_image (line 200) | def get_image(self, idx): FILE: opensora/dataset/t2v_datasets.py function filter_json_by_existed_files (line 42) | def filter_json_by_existed_files(directory, data, postfix=".mp4"): function random_video_noise (line 56) | def random_video_noise(t, c, h, w): class SingletonMeta (line 62) | class SingletonMeta(type): method __call__ (line 68) | def __call__(cls, *args, **kwargs): class DataSetProg (line 75) | class DataSetProg(metaclass=SingletonMeta): method __init__ (line 76) | def __init__(self): method set_cap_list (line 84) | def set_cap_list(self, num_workers, cap_list, n_elements): method get_item (line 100) | def get_item(self, work_info): function find_closest_y (line 113) | def find_closest_y(x, vae_stride_t=4, model_ds_t=1): function filter_resolution (line 128) | def filter_resolution(h, w, max_h_div_w_ratio=17/16, min_h_div_w_ratio=8... function read_parquet (line 133) | def read_parquet(path): class DecordDecoder (line 140) | class DecordDecoder(object): method __init__ (line 141) | def __init__(self, url, num_threads=1): method get_avg_fps (line 149) | def get_avg_fps(self): method get_num_frames (line 152) | def get_num_frames(self): method get_height (line 155) | def get_height(self): method get_width (line 158) | def get_width(self): method get_batch (line 162) | def get_batch(self, frame_indices): class T2V_dataset (line 172) | class T2V_dataset(Dataset): method __init__ (line 173) | def __init__(self, args, transform, temporal_sample, tokenizer_1, toke... method set_checkpoint (line 219) | def set_checkpoint(self, n_used_elements): method __len__ (line 223) | def __len__(self): method __getitem__ (line 226) | def __getitem__(self, idx): method get_data (line 239) | def get_data(self, idx): method get_video (line 246) | def get_video(self, idx): method get_image (line 307) | def get_image(self, idx): method define_frame_index (line 360) | def define_frame_index(self, data): method decord_read (line 568) | def decord_read(self, video_data): method opencv_read (line 597) | def opencv_read(self, video_data): method get_actual_frame (line 625) | def get_actual_frame(self, fps, start_frame_idx, clip_total_frames, pa... FILE: opensora/dataset/transform.py function _is_tensor_video_clip (line 12) | def _is_tensor_video_clip(clip): function center_crop_arr (line 22) | def center_crop_arr(pil_image, image_size): function crop (line 43) | def crop(clip, i, j, h, w): function resize (line 53) | def resize(clip, target_size, interpolation_mode): function resize_scale (line 59) | def resize_scale(clip, target_size, interpolation_mode): function resized_crop (line 67) | def resized_crop(clip, i, j, h, w, size, interpolation_mode="bilinear"): function center_crop (line 87) | def center_crop(clip, crop_size): function center_crop_using_short_edge (line 100) | def center_crop_using_short_edge(clip): function center_crop_th_tw (line 116) | def center_crop_th_tw(clip, th, tw, top_crop): function random_shift_crop (line 137) | def random_shift_crop(clip): function to_tensor (line 159) | def to_tensor(clip): function to_tensor_after_resize (line 175) | def to_tensor_after_resize(clip): function normalize (line 187) | def normalize(clip, mean, std, inplace=False): function hflip (line 207) | def hflip(clip): class RandomCropVideo (line 219) | class RandomCropVideo: method __init__ (line 220) | def __init__(self, size): method __call__ (line 226) | def __call__(self, clip): method get_params (line 237) | def get_params(self, clip): method __repr__ (line 252) | def __repr__(self) -> str: function get_params (line 256) | def get_params(h, w, stride): class SpatialStrideCropVideo (line 265) | class SpatialStrideCropVideo: method __init__ (line 266) | def __init__(self, stride): method __call__ (line 269) | def __call__(self, clip): method __repr__ (line 282) | def __repr__(self) -> str: function longsideresize (line 285) | def longsideresize(h, w, size, skip_low_resolution): function maxhwresize (line 300) | def maxhwresize(ori_height, ori_width, max_hxw): class LongSideResizeVideo (line 310) | class LongSideResizeVideo: method __init__ (line 316) | def __init__( method __call__ (line 326) | def __call__(self, clip): method __repr__ (line 341) | def __repr__(self) -> str: class MaxHWResizeVideo (line 345) | class MaxHWResizeVideo: method __init__ (line 351) | def __init__( method __call__ (line 359) | def __call__(self, clip): method __repr__ (line 374) | def __repr__(self) -> str: class CenterCropResizeVideo (line 378) | class CenterCropResizeVideo: method __init__ (line 384) | def __init__( method __call__ (line 396) | def __call__(self, clip): method __repr__ (line 409) | def __repr__(self) -> str: class UCFCenterCropVideo (line 413) | class UCFCenterCropVideo: method __init__ (line 419) | def __init__( method __call__ (line 433) | def __call__(self, clip): method __repr__ (line 445) | def __repr__(self) -> str: class KineticsRandomCropResizeVideo (line 449) | class KineticsRandomCropResizeVideo: method __init__ (line 454) | def __init__( method __call__ (line 468) | def __call__(self, clip): class CenterCropVideo (line 474) | class CenterCropVideo: method __init__ (line 475) | def __init__( method __call__ (line 489) | def __call__(self, clip): method __repr__ (line 500) | def __repr__(self) -> str: class NormalizeVideo (line 504) | class NormalizeVideo: method __init__ (line 513) | def __init__(self, mean, std, inplace=False): method __call__ (line 518) | def __call__(self, clip): method __repr__ (line 525) | def __repr__(self) -> str: class ToTensorVideo (line 529) | class ToTensorVideo: method __init__ (line 535) | def __init__(self): method __call__ (line 538) | def __call__(self, clip): method __repr__ (line 547) | def __repr__(self) -> str: class ToTensorAfterResize (line 551) | class ToTensorAfterResize: method __init__ (line 557) | def __init__(self): method __call__ (line 560) | def __call__(self, clip): method __repr__ (line 569) | def __repr__(self) -> str: class RandomHorizontalFlipVideo (line 574) | class RandomHorizontalFlipVideo: method __init__ (line 581) | def __init__(self, p=0.5): method __call__ (line 584) | def __call__(self, clip): method __repr__ (line 595) | def __repr__(self) -> str: class TemporalRandomCrop (line 602) | class TemporalRandomCrop(object): method __init__ (line 609) | def __init__(self, size): method __call__ (line 612) | def __call__(self, total_frames): class DynamicSampleDuration (line 618) | class DynamicSampleDuration(object): method __init__ (line 625) | def __init__(self, t_stride, extra_1): method __call__ (line 629) | def __call__(self, t, h, w): function add_masking_notice (line 752) | def add_masking_notice(caption): function add_webvid_watermark_notice (line 758) | def add_webvid_watermark_notice(caption): function add_aesthetic_notice_video (line 762) | def add_aesthetic_notice_video(caption, aesthetic_score): function add_aesthetic_notice_image (line 773) | def add_aesthetic_notice_image(caption, aesthetic_score): function add_high_aesthetic_notice_image (line 782) | def add_high_aesthetic_notice_image(caption): function add_high_aesthetic_notice_image_human (line 786) | def add_high_aesthetic_notice_image_human(caption): function basic_clean (line 790) | def basic_clean(text): function whitespace_clean (line 796) | def whitespace_clean(text): function clean_youtube (line 802) | def clean_youtube(text, is_tags=False): function clean_vidal (line 815) | def clean_vidal(text): function calculate_statistics (line 825) | def calculate_statistics(data): FILE: opensora/dataset/virtual_disk.py class SuppressStdout (line 10) | class SuppressStdout: method __new__ (line 13) | def __new__(cls, *args, **kwargs): method __enter__ (line 18) | def __enter__(self): method __exit__ (line 22) | def __exit__(self, exc_type, exc_value, traceback): class ObsConnection (line 29) | class ObsConnection: method __init__ (line 35) | def __init__(self): method connect (line 44) | def connect(self, obs): class VirtualDisk (line 57) | class VirtualDisk: method __init__ (line 64) | def __init__(self, storage_dir, size="1G", obs="/home/opensora/obsutil... method _convert_size_to_bytes (line 80) | def _convert_size_to_bytes(self, size): method create_ramdisk (line 95) | def create_ramdisk(self): method load_index (line 109) | def load_index(self): method save_index (line 119) | def save_index(self): method unmount_ramdisk (line 131) | def unmount_ramdisk(self): method is_tmpfs_mounted (line 146) | def is_tmpfs_mounted(self): method get_data (line 156) | def get_data(self, key): method del_data (line 190) | def del_data(self, local_path): method download_and_convert_to_pickle (line 193) | def download_and_convert_to_pickle(self, bucket, object_name, local_pa... method ensure_storage_limit (line 208) | def ensure_storage_limit(self): method get_total_storage_size (line 221) | def get_total_storage_size(self): FILE: opensora/models/causalvideovae/__init__.py class CausalVAEModelWrapper (line 15) | class CausalVAEModelWrapper(nn.Module): method __init__ (line 16) | def __init__(self, model_path, subfolder=None, cache_dir=None, use_ema... method encode (line 20) | def encode(self, x): method decode (line 23) | def decode(self, x): method dtype (line 28) | def dtype(self): class WFVAEModelWrapper (line 31) | class WFVAEModelWrapper(nn.Module): method __init__ (line 32) | def __init__(self, model_path, subfolder=None, cache_dir=None, **kwargs): method encode (line 38) | def encode(self, x): method decode (line 42) | def decode(self, x): method dtype (line 48) | def dtype(self): FILE: opensora/models/causalvideovae/dataset/ddp_sampler.py class CustomDistributedSampler (line 9) | class CustomDistributedSampler(Sampler[T_co]): method __init__ (line 58) | def __init__(self, dataset: Dataset, num_replicas: Optional[int] = None, method __iter__ (line 93) | def __iter__(self) -> Iterator[T_co]: method __len__ (line 123) | def __len__(self) -> int: method set_epoch (line 126) | def set_epoch(self, epoch: int) -> None: method state_dict (line 137) | def state_dict(self) -> dict: method load_state_dict (line 144) | def load_state_dict(self, state_dict: dict) -> None: FILE: opensora/models/causalvideovae/dataset/transform.py function _is_tensor_video_clip (line 7) | def _is_tensor_video_clip(clip): function center_crop_arr (line 17) | def center_crop_arr(pil_image, image_size): function crop (line 38) | def crop(clip, i, j, h, w): function resize (line 48) | def resize(clip, target_size, interpolation_mode): function resize_scale (line 54) | def resize_scale(clip, target_size, interpolation_mode): function resized_crop (line 62) | def resized_crop(clip, i, j, h, w, size, interpolation_mode="bilinear"): function center_crop (line 82) | def center_crop(clip, crop_size): function center_crop_using_short_edge (line 95) | def center_crop_using_short_edge(clip): function random_shift_crop (line 110) | def random_shift_crop(clip): function to_tensor (line 132) | def to_tensor(clip): function normalize (line 148) | def normalize(clip, mean, std, inplace=False): function hflip (line 168) | def hflip(clip): class RandomCropVideo (line 180) | class RandomCropVideo: method __init__ (line 181) | def __init__(self, size): method __call__ (line 187) | def __call__(self, clip): method get_params (line 198) | def get_params(self, clip): method __repr__ (line 213) | def __repr__(self) -> str: class SpatialStrideCropVideo (line 217) | class SpatialStrideCropVideo: method __init__ (line 218) | def __init__(self, stride): method __call__ (line 221) | def __call__(self, clip): method get_params (line 232) | def get_params(self, clip): method __repr__ (line 239) | def __repr__(self) -> str: class LongSideResizeVideo (line 242) | class LongSideResizeVideo: method __init__ (line 248) | def __init__( method __call__ (line 258) | def __call__(self, clip): method __repr__ (line 279) | def __repr__(self) -> str: class CenterCropResizeVideo (line 282) | class CenterCropResizeVideo: method __init__ (line 288) | def __init__( method __call__ (line 302) | def __call__(self, clip): method __repr__ (line 315) | def __repr__(self) -> str: class UCFCenterCropVideo (line 319) | class UCFCenterCropVideo: method __init__ (line 325) | def __init__( method __call__ (line 339) | def __call__(self, clip): method __repr__ (line 351) | def __repr__(self) -> str: class KineticsRandomCropResizeVideo (line 355) | class KineticsRandomCropResizeVideo: method __init__ (line 360) | def __init__( method __call__ (line 374) | def __call__(self, clip): class CenterCropVideo (line 380) | class CenterCropVideo: method __init__ (line 381) | def __init__( method __call__ (line 395) | def __call__(self, clip): method __repr__ (line 406) | def __repr__(self) -> str: class NormalizeVideo (line 410) | class NormalizeVideo: method __init__ (line 419) | def __init__(self, mean, std, inplace=False): method __call__ (line 424) | def __call__(self, clip): method __repr__ (line 431) | def __repr__(self) -> str: class ToTensorVideo (line 435) | class ToTensorVideo: method __init__ (line 441) | def __init__(self): method __call__ (line 444) | def __call__(self, clip): method __repr__ (line 453) | def __repr__(self) -> str: class RandomHorizontalFlipVideo (line 457) | class RandomHorizontalFlipVideo: method __init__ (line 464) | def __init__(self, p=0.5): method __call__ (line 467) | def __call__(self, clip): method __repr__ (line 478) | def __repr__(self) -> str: class TemporalRandomCrop (line 485) | class TemporalRandomCrop(object): method __init__ (line 492) | def __init__(self, size): method __call__ (line 495) | def __call__(self, total_frames): class DynamicSampleDuration (line 501) | class DynamicSampleDuration(object): method __init__ (line 508) | def __init__(self, t_stride, extra_1): method __call__ (line 512) | def __call__(self, t, h, w): FILE: opensora/models/causalvideovae/dataset/video_dataset.py class DecordInit (line 19) | class DecordInit(object): method __init__ (line 20) | def __init__(self, num_threads=1): method __call__ (line 24) | def __call__(self, filename): method __repr__ (line 30) | def __repr__(self): function TemporalRandomCrop (line 38) | def TemporalRandomCrop(total_frames, size): function _format_video_shape (line 44) | def _format_video_shape(video, time_compress=4, spatial_compress=8): class TrainVideoDataset (line 63) | class TrainVideoDataset(data.Dataset): method __init__ (line 66) | def __init__( method _make_dataset (line 98) | def _make_dataset(self): method __len__ (line 118) | def __len__(self): method __getitem__ (line 121) | def __getitem__(self, idx): method decord_read (line 132) | def decord_read(self, path): function resize (line 151) | def resize(x, resolution): class ValidVideoDataset (line 163) | class ValidVideoDataset(data.Dataset): method __init__ (line 166) | def __init__( method _make_dataset (line 192) | def _make_dataset(self, real_video_dir): method __len__ (line 212) | def __len__(self): method __getitem__ (line 215) | def __getitem__(self, index): method _load_video (line 228) | def _load_video(self, video_path, sample_rate=None): FILE: opensora/models/causalvideovae/eval/cal_fvd.py function trans (line 5) | def trans(x): function calculate_fvd (line 15) | def calculate_fvd(videos1, videos2, device, method='styleganv'): function main (line 67) | def main(): FILE: opensora/models/causalvideovae/eval/cal_lpips.py function trans (line 15) | def trans(x): function calculate_lpips (line 25) | def calculate_lpips(videos1, videos2, device): function main (line 82) | def main(): FILE: opensora/models/causalvideovae/eval/cal_psnr.py function img_psnr_cuda (line 6) | def img_psnr_cuda(img1, img2): function img_psnr (line 18) | def img_psnr(img1, img2): function trans (line 30) | def trans(x): function calculate_psnr (line 33) | def calculate_psnr(videos1, videos2): function main (line 84) | def main(): FILE: opensora/models/causalvideovae/eval/cal_ssim.py function ssim (line 6) | def ssim(img1, img2): function calculate_ssim_function (line 26) | def calculate_ssim_function(img1, img2): function trans (line 44) | def trans(x): function calculate_ssim (line 47) | def calculate_ssim(videos1, videos2): function main (line 99) | def main(): FILE: opensora/models/causalvideovae/eval/eval.py class EvalDataset (line 26) | class EvalDataset(ValidVideoDataset): method __init__ (line 27) | def __init__( method _make_dataset (line 61) | def _make_dataset(self, real_video_dir): method __len__ (line 72) | def __len__(self): method __getitem__ (line 75) | def __getitem__(self, index): function calculate_common_metric (line 85) | def calculate_common_metric(args, dataloader, device): function main (line 110) | def main(): function parse_args (line 147) | def parse_args(): FILE: opensora/models/causalvideovae/eval/fvd/styleganv/fvd.py function load_i3d_pretrained (line 9) | def load_i3d_pretrained(device=torch.device('cpu')): function get_feats (line 21) | def get_feats(videos, detector, device, bs=10): function get_fvd_feats (line 31) | def get_fvd_feats(videos, i3d, device, bs=10): function preprocess_single (line 38) | def preprocess_single(video, resolution=224, sequence_length=None): function compute_stats (line 75) | def compute_stats(feats: np.ndarray) -> Tuple[np.ndarray, np.ndarray]: function frechet_distance (line 81) | def frechet_distance(feats_fake: np.ndarray, feats_real: np.ndarray) -> ... FILE: opensora/models/causalvideovae/eval/fvd/videogpt/fvd.py function load_i3d_pretrained (line 8) | def load_i3d_pretrained(device=torch.device('cpu')): function preprocess_single (line 21) | def preprocess_single(video, resolution, sequence_length=None): function preprocess (line 51) | def preprocess(videos, target_resolution=224): function get_fvd_logits (line 62) | def get_fvd_logits(videos, i3d, device, bs=10): function _symmetric_matrix_square_root (line 68) | def _symmetric_matrix_square_root(mat, eps=1e-10): function trace_sqrt_product (line 74) | def trace_sqrt_product(sigma, sigma_v): function cov (line 80) | def cov(m, rowvar=False): function frechet_distance (line 113) | def frechet_distance(x1, x2): function get_logits (line 128) | def get_logits(i3d, videos, device, bs=10): FILE: opensora/models/causalvideovae/eval/fvd/videogpt/pytorch_i3d.py class MaxPool3dSamePadding (line 7) | class MaxPool3dSamePadding(nn.MaxPool3d): method compute_pad (line 9) | def compute_pad(self, dim, s): method forward (line 15) | def forward(self, x): class Unit3D (line 37) | class Unit3D(nn.Module): method __init__ (line 39) | def __init__(self, in_channels, method compute_pad (line 71) | def compute_pad(self, dim, s): method forward (line 78) | def forward(self, x): class InceptionModule (line 107) | class InceptionModule(nn.Module): method __init__ (line 108) | def __init__(self, in_channels, out_channels, name): method forward (line 127) | def forward(self, x): class InceptionI3d (line 135) | class InceptionI3d(nn.Module): method __init__ (line 172) | def __init__(self, num_classes=400, spatial_squeeze=True, method replace_logits (line 290) | def replace_logits(self, num_classes): method build (line 301) | def build(self): method forward (line 305) | def forward(self, x): method extract_features (line 318) | def extract_features(self, x): FILE: opensora/models/causalvideovae/model/configuration_videobase.py class VideoBaseConfiguration (line 7) | class VideoBaseConfiguration(ConfigMixin): method __init__ (line 11) | def __init__(self, **kwargs): method to_dict (line 14) | def to_dict(self) -> Dict[str, Any]: method to_yaml_file (line 25) | def to_yaml_file(self, yaml_path: str): method load_from_yaml (line 30) | def load_from_yaml(cls: T, yaml_path: str) -> T: method load_from_dict (line 39) | def load_from_dict(cls: T, config_dict: Dict[str, Any]) -> T: FILE: opensora/models/causalvideovae/model/dataset_videobase.py function TemporalRandomCrop (line 15) | def TemporalRandomCrop(total_frames, size): function resize (line 35) | def resize(x, resolution): class VideoDataset (line 48) | class VideoDataset(data.Dataset): method __init__ (line 52) | def __init__(self, video_folder, sequence_length, image_folder=None, t... method _make_dataset (line 71) | def _make_dataset(self): method __len__ (line 77) | def __len__(self): method __getitem__ (line 80) | def __getitem__(self, idx): method decord_read (line 91) | def decord_read(self, path): FILE: opensora/models/causalvideovae/model/ema_model.py class EMA (line 1) | class EMA: method __init__ (line 2) | def __init__(self, model, decay): method register (line 8) | def register(self): method update (line 13) | def update(self): method apply_shadow (line 19) | def apply_shadow(self): method restore (line 25) | def restore(self): FILE: opensora/models/causalvideovae/model/losses/discriminator.py function weights_init (line 6) | def weights_init(m): function weights_init_conv (line 14) | def weights_init_conv(m): class NLayerDiscriminator3D (line 24) | class NLayerDiscriminator3D(nn.Module): method __init__ (line 26) | def __init__(self, input_nc=1, ndf=64, n_layers=3, use_actnorm=False): method forward (line 71) | def forward(self, input): FILE: opensora/models/causalvideovae/model/losses/lpips.py class LPIPS (line 9) | class LPIPS(nn.Module): method __init__ (line 11) | def __init__(self, use_dropout=True): method load_from_pretrained (line 25) | def load_from_pretrained(self, name="vgg_lpips"): method from_pretrained (line 31) | def from_pretrained(cls, name="vgg_lpips"): method forward (line 39) | def forward(self, input, target): class ScalingLayer (line 55) | class ScalingLayer(nn.Module): method __init__ (line 56) | def __init__(self): method forward (line 61) | def forward(self, inp): class NetLinLayer (line 65) | class NetLinLayer(nn.Module): method __init__ (line 67) | def __init__(self, chn_in, chn_out=1, use_dropout=False): class vgg16 (line 74) | class vgg16(torch.nn.Module): method __init__ (line 75) | def __init__(self, requires_grad=False, pretrained=True): method forward (line 98) | def forward(self, X): function normalize_tensor (line 114) | def normalize_tensor(x,eps=1e-10): function spatial_average (line 119) | def spatial_average(x, keepdim=True): FILE: opensora/models/causalvideovae/model/losses/perceptual_loss.py function hinge_d_loss (line 8) | def hinge_d_loss(logits_real, logits_fake): function vanilla_d_loss (line 15) | def vanilla_d_loss(logits_real, logits_fake): function hinge_d_loss_with_exemplar_weights (line 23) | def hinge_d_loss_with_exemplar_weights(logits_real, logits_fake, weights): function adopt_weight (line 33) | def adopt_weight(weight, global_step, threshold=0, value=0.0): function measure_perplexity (line 39) | def measure_perplexity(predicted_indices, n_embed): function l1 (line 49) | def l1(x, y): function l2 (line 53) | def l2(x, y): class LPIPSWithDiscriminator3D (line 57) | class LPIPSWithDiscriminator3D(nn.Module): method __init__ (line 58) | def __init__( method calculate_adaptive_weight (line 97) | def calculate_adaptive_weight(self, nll_loss, g_loss, last_layer=None): method forward (line 108) | def forward( FILE: opensora/models/causalvideovae/model/modeling_videobase.py class VideoBaseAE (line 12) | class VideoBaseAE(ModelMixin, ConfigMixin): method __init__ (line 15) | def __init__(self, *args, **kwargs) -> None: method encode (line 18) | def encode(self, x: torch.Tensor, *args, **kwargs): method decode (line 21) | def decode(self, encoding: torch.Tensor, *args, **kwargs): method num_training_steps (line 25) | def num_training_steps(self) -> int: method from_pretrained (line 42) | def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union... FILE: opensora/models/causalvideovae/model/modules/attention.py class AttnBlock3D (line 16) | class AttnBlock3D(Block): method __init__ (line 18) | def __init__(self, in_channels): method forward (line 28) | def forward(self, x): class AttnBlock3DFix (line 54) | class AttnBlock3DFix(nn.Module): method __init__ (line 58) | def __init__(self, in_channels, norm_type="groupnorm"): method forward (line 68) | def forward(self, x): FILE: opensora/models/causalvideovae/model/modules/block.py class Block (line 3) | class Block(nn.Module): method __init__ (line 4) | def __init__(self, *args, **kwargs) -> None: FILE: opensora/models/causalvideovae/model/modules/conv.py class Conv2d (line 18) | class Conv2d(nn.Conv2d): method __init__ (line 19) | def __init__( method forward (line 48) | def forward(self, x): class CausalConv3d (line 53) | class CausalConv3d(Block): method __init__ (line 54) | def __init__( method forward (line 88) | def forward(self, x): class CausalConv3d_GC (line 113) | class CausalConv3d_GC(CausalConv3d): method __init__ (line 114) | def __init__( method forward (line 124) | def forward(self, x): FILE: opensora/models/causalvideovae/model/modules/normalize.py class GroupNorm (line 6) | class GroupNorm(Block): method __init__ (line 7) | def __init__(self, num_channels, num_groups=32, eps=1e-6, *args, **kwa... method forward (line 12) | def forward(self, x): class LayerNorm (line 15) | class LayerNorm(Block): method __init__ (line 16) | def __init__(self, num_channels, eps=1e-6, *args, **kwargs) -> None: method forward (line 19) | def forward(self, x): function Normalize (line 30) | def Normalize(in_channels, num_groups=32, norm_type="groupnorm"): FILE: opensora/models/causalvideovae/model/modules/ops.py function video_to_image (line 4) | def video_to_image(func): function nonlinearity (line 23) | def nonlinearity(x): function cast_tuple (line 26) | def cast_tuple(t, length=1): function shift_dim (line 29) | def shift_dim(x, src_dim=-1, dest_dim=-1, make_contiguous=True): FILE: opensora/models/causalvideovae/model/modules/quant.py class Codebook (line 8) | class Codebook(nn.Module): method __init__ (line 9) | def __init__(self, n_codes, embedding_dim): method _tile (line 19) | def _tile(self, x): method _init_embeddings (line 28) | def _init_embeddings(self, z): method forward (line 42) | def forward(self, z): method dictionary_lookup (line 98) | def dictionary_lookup(self, encodings): FILE: opensora/models/causalvideovae/model/modules/resnet_block.py class ResnetBlock2D (line 16) | class ResnetBlock2D(Block): method __init__ (line 17) | def __init__( method forward (line 51) | def forward(self, x): class ResnetBlock3D (line 75) | class ResnetBlock3D(Block): method __init__ (line 76) | def __init__( method forward (line 105) | def forward(self, x): class ResnetBlock3D_GC (line 128) | class ResnetBlock3D_GC(Block): method __init__ (line 129) | def __init__( method forward (line 158) | def forward(self, x): method _forward (line 161) | def _forward(self, x): FILE: opensora/models/causalvideovae/model/modules/updownsample.py class Upsample (line 18) | class Upsample(Block): method __init__ (line 19) | def __init__(self, in_channels, out_channels): method forward (line 30) | def forward(self, x): class Downsample (line 36) | class Downsample(Block): method __init__ (line 37) | def __init__(self, in_channels, out_channels, undown=False): method forward (line 56) | def forward(self, x): class SpatialDownsample2x (line 79) | class SpatialDownsample2x(Block): method __init__ (line 80) | def __init__( method forward (line 102) | def forward(self, x): class SpatialUpsample2x_GC (line 108) | class SpatialUpsample2x_GC(Block): method __init__ (line 109) | def __init__( method forward (line 130) | def forward(self, x): class SpatialUpsample2x (line 140) | class SpatialUpsample2x(Block): method __init__ (line 141) | def __init__( method forward (line 162) | def forward(self, x): class TimeDownsample2x (line 171) | class TimeDownsample2x(Block): method __init__ (line 172) | def __init__( method forward (line 186) | def forward(self, x): class TimeUpsample2x (line 201) | class TimeUpsample2x(Block): method __init__ (line 202) | def __init__( method forward (line 208) | def forward(self, x): class TimeDownsampleRes2x (line 215) | class TimeDownsampleRes2x(Block): method __init__ (line 216) | def __init__( method forward (line 235) | def forward(self, x): class TimeUpsampleRes2x (line 253) | class TimeUpsampleRes2x(Block): method __init__ (line 254) | def __init__( method forward (line 267) | def forward(self, x): class Spatial2xTime2x3DDownsample (line 281) | class Spatial2xTime2x3DDownsample(Block): method __init__ (line 282) | def __init__(self, in_channels, out_channels): method forward (line 286) | def forward(self, x): class Spatial2x3DDownsample (line 292) | class Spatial2x3DDownsample(Block): method __init__ (line 293) | def __init__(self, in_channels, out_channels): method forward (line 297) | def forward(self, x): class Spatial2x3DUpsample (line 304) | class Spatial2x3DUpsample(Block): method __init__ (line 305) | def __init__(self, in_channels, out_channels): method forward (line 309) | def forward(self, x): class Spatial2xTime2x3DUpsample (line 313) | class Spatial2xTime2x3DUpsample(Block): method __init__ (line 314) | def __init__( method forward (line 327) | def forward(self, x): FILE: opensora/models/causalvideovae/model/modules/wavelet.py class HaarWaveletTransform3D (line 15) | class HaarWaveletTransform3D(nn.Module): method __init__ (line 16) | def __init__(self, *args, **kwargs) -> None: method forward (line 61) | def forward(self, x): class InverseHaarWaveletTransform3D (line 109) | class InverseHaarWaveletTransform3D(nn.Module): method __init__ (line 110) | def __init__(self, enable_cached=False, *args, **kwargs) -> None: method forward (line 140) | def forward(self, coeffs): class HaarWaveletTransform2D (line 227) | class HaarWaveletTransform2D(nn.Module): method __init__ (line 228) | def __init__(self): method forward (line 236) | def forward(self, x): class InverseHaarWaveletTransform2D (line 246) | class InverseHaarWaveletTransform2D(nn.Module): method __init__ (line 247) | def __init__(self): method forward (line 255) | def forward(self, coeffs): FILE: opensora/models/causalvideovae/model/registry.py class ModelRegistry (line 1) | class ModelRegistry: method register (line 5) | def register(cls, model_name): method get_model (line 12) | def get_model(cls, model_name): FILE: opensora/models/causalvideovae/model/trainer_videobase.py class VideoBaseTrainer (line 9) | class VideoBaseTrainer(Trainer): method _save (line 11) | def _save(self, output_dir: Optional[str] = None, state_dict=None): FILE: opensora/models/causalvideovae/model/utils/distrib_utils.py class DiagonalGaussianDistribution (line 4) | class DiagonalGaussianDistribution(object): method __init__ (line 5) | def __init__(self, parameters, deterministic=False): method sample (line 15) | def sample(self): method kl (line 19) | def kl(self, other=None): method nll (line 33) | def nll(self, sample, dims=[1,2,3]): method mode (line 41) | def mode(self): FILE: opensora/models/causalvideovae/model/utils/module_utils.py function resolve_str_to_obj (line 6) | def resolve_str_to_obj(str_val, append=True): function create_instance (line 13) | def create_instance(module_class_str: str, **kwargs): FILE: opensora/models/causalvideovae/model/utils/scheduler_utils.py function cosine_scheduler (line 3) | def cosine_scheduler(step, max_steps, value_base=1, value_end=0): FILE: opensora/models/causalvideovae/model/utils/video_utils.py function tensor_to_video (line 4) | def tensor_to_video(x): FILE: opensora/models/causalvideovae/model/utils/wavelet_utils.py class HaarWaveletTransform3D (line 7) | class HaarWaveletTransform3D(nn.Module): method __init__ (line 8) | def __init__(self, *args, **kwargs) -> None: method forward (line 53) | def forward(self, x): class InverseHaarWaveletTransform3D (line 89) | class InverseHaarWaveletTransform3D(nn.Module): method __init__ (line 90) | def __init__(self, enable_cached=False, *args, **kwargs) -> None: method forward (line 120) | def forward(self, coeffs): class HaarWaveletTransform2D (line 179) | class HaarWaveletTransform2D(nn.Module): method __init__ (line 180) | def __init__(self): method forward (line 187) | def forward(self, x): class InverseHaarWaveletTransform2D (line 197) | class InverseHaarWaveletTransform2D(nn.Module): method __init__ (line 198) | def __init__(self): method forward (line 205) | def forward(self, coeffs): FILE: opensora/models/causalvideovae/model/vae/modeling_causalvae.py class Encoder (line 22) | class Encoder(nn.Module): method __init__ (line 23) | def __init__( method forward (line 127) | def forward(self, x): class Decoder (line 151) | class Decoder(nn.Module): method __init__ (line 152) | def __init__( method forward (line 247) | def forward(self, z): class CausalVAEModel (line 272) | class CausalVAEModel(VideoBaseAE): method __init__ (line 274) | def __init__( method get_encoder (line 391) | def get_encoder(self): method get_decoder (line 396) | def get_decoder(self): method encode (line 401) | def encode(self, x): method decode (line 415) | def decode(self, z): method forward (line 427) | def forward(self, input, sample_posterior=True): method on_train_start (line 436) | def on_train_start(self): method get_last_layer (line 439) | def get_last_layer(self): method blend_v (line 445) | def blend_v( method blend_h (line 455) | def blend_h( method tiled_encode (line 465) | def tiled_encode(self, x): method tiled_decode (line 491) | def tiled_decode(self, x): method tiled_encode2d (line 518) | def tiled_encode2d(self, x, return_moments=False): method tiled_decode2d (line 560) | def tiled_decode2d(self, z): method enable_tiling (line 602) | def enable_tiling(self, use_tiling: bool = True): method disable_tiling (line 605) | def disable_tiling(self): method init_from_ckpt (line 608) | def init_from_ckpt(self, path, ignore_keys=list()): FILE: opensora/models/causalvideovae/model/vae/modeling_wfvae.py class Encoder (line 34) | class Encoder(VideoBaseAE): method __init__ (line 37) | def __init__( method forward (line 128) | def forward(self, x): class Decoder (line 153) | class Decoder(VideoBaseAE): method __init__ (line 156) | def __init__( method forward (line 286) | def forward(self, z): class WFVAEModel (line 316) | class WFVAEModel(VideoBaseAE): method __init__ (line 319) | def __init__( method get_encoder (line 389) | def get_encoder(self): method get_decoder (line 394) | def get_decoder(self): method _empty_causal_cached (line 399) | def _empty_causal_cached(self, parent): method _set_causal_cached (line 404) | def _set_causal_cached(self, enable_cached=True): method _set_cache_offset (line 409) | def _set_cache_offset(self, modules, cache_offset=0): method _set_first_chunk (line 415) | def _set_first_chunk(self, is_first_chunk=True): method build_chunk_start_end (line 420) | def build_chunk_start_end(self, t, decoder_mode=False): method encode (line 432) | def encode(self, x): method tile_encode (line 448) | def tile_encode(self, x): method decode (line 464) | def decode(self, z): method tile_decode (line 478) | def tile_decode(self, x): method forward (line 504) | def forward(self, input, sample_posterior=True): method get_last_layer (line 513) | def get_last_layer(self): method enable_tiling (line 519) | def enable_tiling(self, use_tiling: bool = True): method disable_tiling (line 523) | def disable_tiling(self): method init_from_ckpt (line 526) | def init_from_ckpt(self, path, ignore_keys=list()): FILE: opensora/models/causalvideovae/sample/rec_video_vae.py function main (line 15) | def main(args: argparse.Namespace): FILE: opensora/models/causalvideovae/utils/dataset_utils.py function is_image_file (line 10) | def is_image_file(filename): class DecordInit (line 13) | class DecordInit(object): method __init__ (line 16) | def __init__(self, num_threads=1): method __call__ (line 20) | def __call__(self, filename): method __repr__ (line 31) | def __repr__(self): function pad_to_multiple (line 37) | def pad_to_multiple(number, ds_stride): FILE: opensora/models/causalvideovae/utils/downloader.py function gdown_download (line 9) | def gdown_download(id, fname, cache_dir=None): FILE: opensora/models/causalvideovae/utils/video_utils.py function array_to_video (line 7) | def array_to_video( function custom_to_video (line 21) | def custom_to_video( function read_video (line 32) | def read_video(video_path: str, num_frames: int, sample_rate: int) -> to... function tensor_to_video (line 57) | def tensor_to_video(x): FILE: opensora/models/diffusion/common.py class PatchEmbed2D (line 20) | class PatchEmbed2D(nn.Module): method __init__ (line 23) | def __init__( method forward (line 36) | def forward(self, latent): class PositionGetter3D (line 44) | class PositionGetter3D(object): method __init__ (line 47) | def __init__(self, ): method __call__ (line 50) | def __call__(self, b, t, h, w, device): class RoPE3D (line 66) | class RoPE3D(torch.nn.Module): method __init__ (line 68) | def __init__(self, freq=10000.0, F0=1.0, interpolation_scale_thw=(1, 1... method get_cos_sin (line 77) | def get_cos_sin(self, D, seq_len, device, dtype, interpolation_scale=1): method rotate_half (line 89) | def rotate_half(x): method apply_rope1d (line 93) | def apply_rope1d(self, tokens, pos1d, cos, sin): method forward (line 101) | def forward(self, tokens, positions): FILE: opensora/models/diffusion/opensora_v1_3/modeling_inpaint.py function zero_module (line 16) | def zero_module(module): class OpenSoraInpaint_v1_3 (line 22) | class OpenSoraInpaint_v1_3(OpenSoraT2V): method __init__ (line 26) | def __init__( method _init_patched_inputs_for_inpainting (line 88) | def _init_patched_inputs_for_inpainting(self): method _operate_on_patched_inputs (line 114) | def _operate_on_patched_inputs(self, hidden_states, encoder_hidden_sta... function OpenSoraInpaint_v1_3_2B_122 (line 142) | def OpenSoraInpaint_v1_3_2B_122(**kwargs): FILE: opensora/models/diffusion/opensora_v1_3/modeling_opensora.py class OpenSoraT2V_v1_3 (line 26) | class OpenSoraT2V_v1_3(ModelMixin, ConfigMixin): method __init__ (line 30) | def __init__( method _init_patched_inputs (line 65) | def _init_patched_inputs(self): method _set_gradient_checkpointing (line 114) | def _set_gradient_checkpointing(self, module, value=False): method forward (line 118) | def forward( method _operate_on_patched_inputs (line 253) | def _operate_on_patched_inputs(self, hidden_states, encoder_hidden_sta... method _get_output_for_patched_inputs (line 270) | def _get_output_for_patched_inputs( function OpenSoraT2V_v1_3_2B_122 (line 291) | def OpenSoraT2V_v1_3_2B_122(**kwargs): FILE: opensora/models/diffusion/opensora_v1_3/modules.py class Attention (line 30) | class Attention(Attention_): method __init__ (line 31) | def __init__( method prepare_sparse_mask (line 42) | def prepare_sparse_mask(attention_mask, encoder_attention_mask, sparse... method prepare_attention_mask (line 88) | def prepare_attention_mask( class OpenSoraAttnProcessor2_0 (line 128) | class OpenSoraAttnProcessor2_0: method __init__ (line 133) | def __init__(self, interpolation_scale_thw=(1, 1, 1), method _init_rope (line 145) | def _init_rope(self, interpolation_scale_thw): method _sparse_1d (line 149) | def _sparse_1d(self, x, frame, height, width): method _reverse_sparse_1d (line 166) | def _reverse_sparse_1d(self, x, frame, height, width, pad_len): method _sparse_1d_kv (line 178) | def _sparse_1d_kv(self, x): method __call__ (line 185) | def __call__( class BasicTransformerBlock (line 316) | class BasicTransformerBlock(nn.Module): method __init__ (line 317) | def __init__( method forward (line 395) | def forward( FILE: opensora/models/frame_interpolation/interpolation.py function init (line 35) | def init(device="cuda"): function get_input_video_from_path (line 56) | def get_input_video_from_path(input_path, device="cuda"): function load_model (line 103) | def load_model(ckpt_path, device="cuda"): function interpolater (line 118) | def interpolater(model, inputs, scale, padder, iters=1): function write (line 150) | def write(outputs, input_path, output_path, frame_rate=30): FILE: opensora/models/frame_interpolation/networks/AMT-G.py class Model (line 23) | class Model(nn.Module): method __init__ (line 24) | def __init__(self, method _get_updateblock (line 55) | def _get_updateblock(self, cdim, scale_factor=None): method _corr_scale_lookup (line 61) | def _corr_scale_lookup(self, corr_fn, coord, flow0, flow1, embt, downs... method forward (line 76) | def forward(self, img0, img1, embt, scale_factor=1.0, eval=False, **kw... FILE: opensora/models/frame_interpolation/networks/blocks/feat_enc.py class BottleneckBlock (line 5) | class BottleneckBlock(nn.Module): method __init__ (line 6) | def __init__(self, in_planes, planes, norm_fn='group', stride=1): method forward (line 52) | def forward(self, x): class ResidualBlock (line 64) | class ResidualBlock(nn.Module): method __init__ (line 65) | def __init__(self, in_planes, planes, norm_fn='group', stride=1): method forward (line 106) | def forward(self, x): class SmallEncoder (line 117) | class SmallEncoder(nn.Module): method __init__ (line 118) | def __init__(self, output_dim=128, norm_fn='batch', dropout=0.0): method _make_layer (line 157) | def _make_layer(self, dim, stride=1): method forward (line 166) | def forward(self, x): class BasicEncoder (line 191) | class BasicEncoder(nn.Module): method __init__ (line 192) | def __init__(self, output_dim=128, norm_fn='batch', dropout=0.0): method _make_layer (line 232) | def _make_layer(self, dim, stride=1): method forward (line 241) | def forward(self, x): class LargeEncoder (line 267) | class LargeEncoder(nn.Module): method __init__ (line 268) | def __init__(self, output_dim=128, norm_fn='batch', dropout=0.0): method _make_layer (line 309) | def _make_layer(self, dim, stride=1): method forward (line 318) | def forward(self, x): FILE: opensora/models/frame_interpolation/networks/blocks/ifrnet.py function resize (line 7) | def resize(x, scale_factor): function convrelu (line 10) | def convrelu(in_channels, out_channels, kernel_size=3, stride=1, padding... class ResBlock (line 16) | class ResBlock(nn.Module): method __init__ (line 17) | def __init__(self, in_channels, side_channels, bias=True): method forward (line 39) | def forward(self, x): class Encoder (line 55) | class Encoder(nn.Module): method __init__ (line 56) | def __init__(self, channels, large=False): method forward (line 70) | def forward(self, in_x): class InitDecoder (line 78) | class InitDecoder(nn.Module): method __init__ (line 79) | def __init__(self, in_ch, out_ch, skip_ch) -> None: method forward (line 86) | def forward(self, f0, f1, embt): class IntermediateDecoder (line 94) | class IntermediateDecoder(nn.Module): method __init__ (line 95) | def __init__(self, in_ch, out_ch, skip_ch) -> None: method forward (line 102) | def forward(self, ft_, f0, f1, flow0_in, flow1_in): FILE: opensora/models/frame_interpolation/networks/blocks/multi_flow.py function multi_flow_combine (line 10) | def multi_flow_combine(comb_block, img0, img1, flow0, flow1, class MultiFlowDecoder (line 46) | class MultiFlowDecoder(nn.Module): method __init__ (line 47) | def __init__(self, in_ch, skip_ch, num_flows=3): method forward (line 56) | def forward(self, ft_, f0, f1, flow0, flow1): FILE: opensora/models/frame_interpolation/networks/blocks/raft.py function resize (line 6) | def resize(x, scale_factor): function bilinear_sampler (line 10) | def bilinear_sampler(img, coords, mask=False): function coords_grid (line 27) | def coords_grid(batch, ht, wd, device): class SmallUpdateBlock (line 35) | class SmallUpdateBlock(nn.Module): method __init__ (line 36) | def __init__(self, cdim, hidden_dim, flow_dim, corr_dim, fc_dim, method forward (line 67) | def forward(self, net, flow, corr): class BasicUpdateBlock (line 88) | class BasicUpdateBlock(nn.Module): method __init__ (line 89) | def __init__(self, cdim, hidden_dim, flow_dim, corr_dim, corr_dim2, method forward (line 121) | def forward(self, net, flow, corr): class BidirCorrBlock (line 142) | class BidirCorrBlock: method __init__ (line 143) | def __init__(self, fmap1, fmap2, num_levels=4, radius=4): method __call__ (line 165) | def __call__(self, coords0, coords1): method corr (line 200) | def corr(fmap1, fmap2): FILE: opensora/models/frame_interpolation/utils/build_utils.py function base_build_fn (line 4) | def base_build_fn(module, cls, params): function build_from_cfg (line 9) | def build_from_cfg(config): FILE: opensora/models/frame_interpolation/utils/dist_utils.py function get_world_size (line 5) | def get_world_size(): function get_global_rank (line 17) | def get_global_rank(): function get_local_rank (line 29) | def get_local_rank(): function get_master_ip (line 41) | def get_master_ip(): FILE: opensora/models/frame_interpolation/utils/flow_utils.py function warp (line 8) | def warp(img, flow): function make_colorwheel (line 19) | def make_colorwheel(): function flow_uv_to_colors (line 66) | def flow_uv_to_colors(u, v, convert_to_bgr=False): function flow_to_image (line 101) | def flow_to_image(flow_uv, clip_flow=None, convert_to_bgr=False): FILE: opensora/models/frame_interpolation/utils/utils.py class AverageMeter (line 12) | class AverageMeter(): method __init__ (line 13) | def __init__(self): method reset (line 16) | def reset(self): method update (line 22) | def update(self, val, n=1): class AverageMeterGroups (line 29) | class AverageMeterGroups: method __init__ (line 30) | def __init__(self) -> None: method update (line 33) | def update(self, dict, n=1): method reset (line 39) | def reset(self, name=None): method avg (line 48) | def avg(self, name): class InputPadder (line 54) | class InputPadder: method __init__ (line 56) | def __init__(self, dims, divisor=16): method pad (line 62) | def pad(self, *inputs): method unpad (line 68) | def unpad(self, *inputs): method _unpad (line 74) | def _unpad(self, x): function img2tensor (line 80) | def img2tensor(img): function tensor2img (line 86) | def tensor2img(img_t): function seed_all (line 91) | def seed_all(seed): function read (line 98) | def read(file): function write (line 109) | def write(file, data): function readPFM (line 120) | def readPFM(file): function writePFM (line 158) | def writePFM(file, image, scale=1): function readFlow (line 188) | def readFlow(name): function readImage (line 206) | def readImage(name): function writeImage (line 216) | def writeImage(name, data): function writeFlow (line 222) | def writeFlow(name, flow): function readFloat (line 230) | def readFloat(name): function writeFloat (line 255) | def writeFloat(name, data): function check_dim_and_resize (line 281) | def check_dim_and_resize(tensor_list): FILE: opensora/models/prompt_refiner/inference.py function get_output (line 6) | def get_output(prompt): function parse_args (line 27) | def parse_args(): FILE: opensora/models/prompt_refiner/merge.py function get_lora_model (line 8) | def get_lora_model(base_model_path, lora_model_input_path, lora_model_ou... function get_model_result (line 19) | def get_model_result(base_model_path, fintune_model_path): function parse_args (line 72) | def parse_args(): FILE: opensora/models/prompt_refiner/train.py function parse_args (line 12) | def parse_args(): function process_func (line 28) | def process_func(example): FILE: opensora/models/text_encoder/__init__.py function get_text_warpper (line 15) | def get_text_warpper(text_encoder_name): FILE: opensora/models/text_encoder/clip.py class CLIPWrapper (line 10) | class CLIPWrapper(nn.Module): method __init__ (line 11) | def __init__(self, args, **kwargs): method forward (line 21) | def forward(self, input_ids, attention_mask): FILE: opensora/models/text_encoder/t5.py class T5Wrapper (line 10) | class T5Wrapper(nn.Module): method __init__ (line 11) | def __init__(self, args, **kwargs): method forward (line 17) | def forward(self, input_ids, attention_mask): FILE: opensora/npu_config.py function compress_video (line 28) | def compress_video(input_file, output_file, out_size): function set_run_dtype (line 44) | def set_run_dtype(x, dtype=None): class NPUConfig (line 58) | class NPUConfig: method __init__ (line 61) | def __init__(self): method get_total_cores (line 120) | def get_total_cores(self): method bind_thread_to_cpu (line 128) | def bind_thread_to_cpu(self): method replace_methods (line 145) | def replace_methods(self, target_class, source_class, skip_fcns=[], on... method get_attention_mask (line 163) | def get_attention_mask(self, attention_mask, repeat_num): method set_current_run_dtype (line 169) | def set_current_run_dtype(self, variables): method restore_dtype (line 175) | def restore_dtype(self, x): method get_output_video_path (line 180) | def get_output_video_path(self, name): method get_node_id (line 184) | def get_node_id(self): method get_node_size (line 187) | def get_node_size(self): method get_local_rank (line 190) | def get_local_rank(self): method get_pickle_path (line 193) | def get_pickle_path(self, file_name): method free_mm (line 196) | def free_mm(self): method __del__ (line 201) | def __del__(self): method try_load_pickle (line 204) | def try_load_pickle(self, file_name, function): method try_get_vid_path (line 223) | def try_get_vid_path(self, file, out_size=1024): method npu_format_cast (line 230) | def npu_format_cast(self, x): method calc_grad_norm (line 233) | def calc_grad_norm(self, model): method _run (line 253) | def _run(self, operator, x, tmp_dtype, out_dtype=None, out_nd_format=F... method run_group_norm (line 268) | def run_group_norm(self, operator, x): method run_layer_norm (line 271) | def run_layer_norm(self, operator, x): method print_tensor_stats (line 274) | def print_tensor_stats(self, tensor, name="Tensor", rank=None): method run_conv3d (line 295) | def run_conv3d(self, operator, x, out_dtype): method run_pool_2d (line 298) | def run_pool_2d(self, operator, x): method run_pad_2d (line 301) | def run_pad_2d(self, operator, x, pad, mode="constant"): method seed_everything (line 311) | def seed_everything(self, seed=100): method print_with_rank (line 321) | def print_with_rank(self, msg, rank=0, save=False): method print_msg (line 327) | def print_msg(self, msg, on=True, rank=None): method save_loss (line 332) | def save_loss(self, filename, rank=0): method run_attention (line 338) | def run_attention(self, query, key, value, atten_mask, input_layout, h... method scaled_dot_product_attention (line 353) | def scaled_dot_product_attention(self, query, key, value, input_layout... method print_tensor_with_rank (line 393) | def print_tensor_with_rank(self, name, tensor, rank=[0], dim_print_cnt... FILE: opensora/sample/caption_refiner.py class OpenSoraCaptionRefiner (line 13) | class OpenSoraCaptionRefiner(nn.Module): method __init__ (line 14) | def __init__(self, args, dtype, device): method get_refiner_output (line 24) | def get_refiner_output(self, prompt): FILE: opensora/sample/pipeline_inpaint.py function is_video_file (line 44) | def is_video_file(file_path): function is_image_file (line 49) | def is_image_file(file_path): function open_image (line 54) | def open_image(file_path): function open_video (line 58) | def open_video(file_path, start_frame_idx, num_frames, frame_interval=1): function get_pixel_values (line 77) | def get_pixel_values(file_path, num_frames): class OpenSoraInpaintPipeline (line 87) | class OpenSoraInpaintPipeline(OpenSoraPipeline): method __init__ (line 89) | def __init__( method check_inputs (line 116) | def check_inputs( method get_resize_transform (line 181) | def get_resize_transform( method get_video_transform (line 205) | def get_video_transform(self): method get_mask_type_cond_indices (line 213) | def get_mask_type_cond_indices(self, mask_type, conditional_pixel_valu... method get_masked_pixel_values_mask (line 237) | def get_masked_pixel_values_mask( method __call__ (line 293) | def __call__( FILE: opensora/sample/pipeline_opensora.py class OpenSoraPipelineOutput (line 32) | class OpenSoraPipelineOutput(BaseOutput): function rescale_noise_cfg (line 36) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function retrieve_timesteps (line 51) | def retrieve_timesteps( class OpenSoraPipeline (line 110) | class OpenSoraPipeline(DiffusionPipeline): method __init__ (line 127) | def __init__( method encode_prompt (line 149) | def encode_prompt( method prepare_extra_step_kwargs (line 323) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 340) | def check_inputs( method prepare_latents (line 420) | def prepare_latents(self, batch_size, num_channels_latents, num_frames... method guidance_scale (line 445) | def guidance_scale(self): method guidance_rescale (line 449) | def guidance_rescale(self): method do_classifier_free_guidance (line 453) | def do_classifier_free_guidance(self): method num_timesteps (line 457) | def num_timesteps(self): method interrupt (line 461) | def interrupt(self): method __call__ (line 465) | def __call__( method decode_latents (line 743) | def decode_latents(self, latents): FILE: opensora/sample/rec_image.py function preprocess (line 11) | def preprocess(video_data: torch.Tensor, short_size: int = 128) -> torch... function main (line 23) | def main(args: argparse.Namespace): FILE: opensora/sample/rec_video.py function array_to_video (line 20) | def array_to_video(image_array: npt.NDArray, fps: float = 30.0, output_f... function custom_to_video (line 32) | def custom_to_video(x: torch.Tensor, fps: float = 2.0, output_file: str ... function read_video (line 42) | def read_video(video_path: str, num_frames: int, sample_rate: int) -> to... function preprocess (line 68) | def preprocess(video_data: torch.Tensor, height: int = 128, width: int =... function main (line 83) | def main(args: argparse.Namespace): FILE: opensora/serve/gradio_utils.py function randomize_seed_fn (line 22) | def randomize_seed_fn(seed: int, randomize_seed: bool) -> int: FILE: opensora/serve/gradio_web_server.py function generate (line 24) | def generate( FILE: opensora/serve/gradio_web_server_i2v.py function generate (line 24) | def generate( FILE: opensora/train/train_causalvae.py function set_random_seed (line 34) | def set_random_seed(seed): function ddp_setup (line 41) | def ddp_setup(): function setup_logger (line 45) | def setup_logger(rank): function check_unused_params (line 70) | def check_unused_params(model): function set_requires_grad_optimizer (line 77) | def set_requires_grad_optimizer(optimizer, requires_grad): function total_params (line 82) | def total_params(model): function get_exp_name (line 88) | def get_exp_name(args): function set_train (line 92) | def set_train(modules): function set_eval (line 97) | def set_eval(modules): function set_modules_requires_grad (line 102) | def set_modules_requires_grad(modules, requires_grad): function save_checkpoint (line 107) | def save_checkpoint( function valid (line 134) | def valid(global_rank, rank, model, val_dataloader, precision, args): function gather_valid_result (line 195) | def gather_valid_result(psnr_list, lpips_list, video_log_list, rank, wor... function train (line 210) | def train(args): function main (line 571) | def main(): FILE: opensora/train/train_inpaint.py class ProgressInfo (line 85) | class ProgressInfo: method __init__ (line 86) | def __init__(self, global_step, train_loss=0.0): function main (line 95) | def main(args): FILE: opensora/train/train_t2v_diffusers.py function log_validation (line 82) | def log_validation(args, model, vae, text_encoder, tokenizer, accelerato... class ProgressInfo (line 155) | class ProgressInfo: method __init__ (line 156) | def __init__(self, global_step, train_loss=0.0): function main (line 165) | def main(args): FILE: opensora/utils/communications.py function broadcast (line 6) | def broadcast(input_: torch.Tensor): function _all_to_all (line 12) | def _all_to_all( function _single_all_to_all (line 24) | def _single_all_to_all( class _AllToAll (line 56) | class _AllToAll(torch.autograd.Function): method forward (line 67) | def forward(ctx, input_, scatter_dim, gather_dim, all_to_all_func): method backward (line 75) | def backward(ctx, grad_output): function all_to_all_SBH (line 88) | def all_to_all_SBH( function all_to_all_BSND (line 95) | def all_to_all_BSND( function prepare_parallel_data (line 103) | def prepare_parallel_data( FILE: opensora/utils/dataset_utils.py function is_image_file (line 18) | def is_image_file(filename): class DecordInit (line 21) | class DecordInit(object): method __init__ (line 24) | def __init__(self, num_threads=1): method __call__ (line 28) | def __call__(self, filename): method __repr__ (line 39) | def __repr__(self): function pad_to_multiple (line 45) | def pad_to_multiple(number, ds_stride): class Collate (line 53) | class Collate: method __init__ (line 54) | def __init__(self, args): method package (line 72) | def package(self, batch): method __call__ (line 86) | def __call__(self, batch): method process (line 99) | def process(self, batch_tubes, input_ids_1, cond_mask_1, input_ids_2, ... function group_data_fun (line 181) | def group_data_fun(lengths, generator=None): function last_group_data_fun (line 198) | def last_group_data_fun(shuffled_megabatches, lengths): function split_to_even_chunks (line 237) | def split_to_even_chunks(megabatch, lengths, world_size, batch_size): function get_length_grouped_indices (line 260) | def get_length_grouped_indices(lengths, batch_size, world_size, gradient... class LengthGroupedSampler (line 327) | class LengthGroupedSampler(Sampler): method __init__ (line 333) | def __init__( method __len__ (line 356) | def __len__(self): method __iter__ (line 359) | def __iter__(self): FILE: opensora/utils/downloader.py function gdown_download (line 9) | def gdown_download(id, fname, cache_dir=None): FILE: opensora/utils/ema.py class EMAModel (line 23) | class EMAModel: method __init__ (line 28) | def __init__( method extract_ema_kwargs (line 110) | def extract_ema_kwargs(cls, kwargs): method from_pretrained (line 129) | def from_pretrained(cls, path, model_cls) -> "EMAModel": method save_pretrained (line 139) | def save_pretrained(self, path): method get_decay (line 154) | def get_decay(self, optimization_step: int) -> float: method step (line 174) | def step(self, parameters: Iterable[torch.nn.Parameter]): method copy_to (line 211) | def copy_to(self, parameters: Iterable[torch.nn.Parameter]) -> None: method to (line 225) | def to(self, device=None, dtype=None) -> None: method state_dict (line 237) | def state_dict(self) -> dict: method store (line 256) | def store(self, parameters: Iterable[torch.nn.Parameter]) -> None: method restore (line 265) | def restore(self, parameters: Iterable[torch.nn.Parameter]) -> None: method load_state_dict (line 283) | def load_state_dict(self, state_dict: dict) -> None: FILE: opensora/utils/ema_utils.py class EMAModel (line 11) | class EMAModel(diffuser_EMAModel): method __init__ (line 12) | def __init__(self, parameters, **kwargs): method from_pretrained (line 17) | def from_pretrained(cls, path, model_cls, lora_config, model_base) -> ... method save_pretrained (line 36) | def save_pretrained(self, path): FILE: opensora/utils/freeinit_utils.py function freq_mix_3d (line 6) | def freq_mix_3d(x, noise, LPF): function get_freq_filter (line 34) | def get_freq_filter(shape, device, filter_type, n, d_s, d_t): function gaussian_low_pass_filter (line 56) | def gaussian_low_pass_filter(shape, d_s=0.25, d_t=0.25): function butterworth_low_pass_filter (line 77) | def butterworth_low_pass_filter(shape, n=4, d_s=0.25, d_t=0.25): function ideal_low_pass_filter (line 99) | def ideal_low_pass_filter(shape, d_s=0.25, d_t=0.25): function box_low_pass_filter (line 120) | def box_low_pass_filter(shape, d_s=0.25, d_t=0.25): FILE: opensora/utils/lora_utils.py function maybe_zero_3 (line 8) | def maybe_zero_3(param, ignore_status=False, name=None): function get_peft_state_maybe_zero_3 (line 22) | def get_peft_state_maybe_zero_3(named_params, bias): FILE: opensora/utils/mask_utils.py class MaskType (line 20) | class MaskType(Enum): function save_mask_to_video (line 31) | def save_mask_to_video(mask, save_path='mask.mp4', fps=24): function read_video (line 40) | def read_video(video_path): class BaseMaskGenerator (line 51) | class BaseMaskGenerator(ABC): method create_system_mask (line 53) | def create_system_mask(self, num_frames, height, width, device, dtype): method process (line 59) | def process(self, mask): method __call__ (line 63) | def __call__(self, num_frames=None, height=None, width=None, device='c... class T2IVMaskGenerator (line 67) | class T2IVMaskGenerator(BaseMaskGenerator): method process (line 68) | def process(self, mask): class I2VMaskGenerator (line 72) | class I2VMaskGenerator(BaseMaskGenerator): method process (line 73) | def process(self, mask): class TransitionMaskGenerator (line 77) | class TransitionMaskGenerator(BaseMaskGenerator): method process (line 78) | def process(self, mask): class ContinuationMaskGenerator (line 83) | class ContinuationMaskGenerator(BaseMaskGenerator): method __init__ (line 85) | def __init__(self, min_clear_ratio=0.0, max_clear_ratio=1.0): method process (line 92) | def process(self, mask): class ClearMaskGenerator (line 98) | class ClearMaskGenerator(BaseMaskGenerator): method process (line 99) | def process(self, mask): class RandomTemporalMaskGenerator (line 103) | class RandomTemporalMaskGenerator(BaseMaskGenerator): method __init__ (line 105) | def __init__(self, min_clear_ratio=0.0, max_clear_ratio=1.0): method process (line 112) | def process(self, mask): class MaskProcessor (line 120) | class MaskProcessor: method __init__ (line 121) | def __init__( method init_mask_generators (line 136) | def init_mask_generators(self): method get_mask (line 146) | def get_mask(self, mask_generator_type, num_frames, height, width, dev... method __call__ (line 149) | def __call__(self, pixel_values, mask_type=None, mask_type_ratio_dict=... class MaskCompressor (line 168) | class MaskCompressor: method __init__ (line 169) | def __init__(self, ae_stride_h=8, ae_stride_w=8, ae_stride_t=4, **kwar... method __call__ (line 174) | def __call__(self, mask): class BaseNoiseAdder (line 196) | class BaseNoiseAdder(ABC): method add_noise (line 199) | def add_noise(self, mask_pixel_values, mask): method __call__ (line 202) | def __call__(self, mask_pixel_values, mask): class GaussianNoiseAdder (line 205) | class GaussianNoiseAdder(BaseNoiseAdder): method __init__ (line 206) | def __init__(self, mean=-3.0, std=0.5, clear_ratio=0.05): method add_noise (line 212) | def add_noise(self, masked_pixel_values, mask): FILE: opensora/utils/parallel_states.py class COMM_INFO (line 5) | class COMM_INFO: method __init__ (line 6) | def __init__(self): function initialize_sequence_parallel_state (line 13) | def initialize_sequence_parallel_state(sequence_parallel_size): function set_sequence_parallel_state (line 19) | def set_sequence_parallel_state(state): function get_sequence_parallel_state (line 23) | def get_sequence_parallel_state(): function initialize_sequence_parallel_group (line 26) | def initialize_sequence_parallel_group(sequence_parallel_size): function destroy_sequence_parallel_group (line 42) | def destroy_sequence_parallel_group(): FILE: opensora/utils/sample_utils.py function get_scheduler (line 38) | def get_scheduler(args): function prepare_pipeline (line 82) | def prepare_pipeline(args, dtype, device): function init_gpu_env (line 166) | def init_gpu_env(args): function init_npu_env (line 180) | def init_npu_env(args): function save_video_grid (line 195) | def save_video_grid(video, nrow=None): function run_model_and_save_samples (line 222) | def run_model_and_save_samples(args, pipeline, caption_refiner_model=Non... function run_model_and_save_samples_npu (line 417) | def run_model_and_save_samples_npu(args, pipeline, caption_refiner_model... function get_args (line 443) | def get_args(): FILE: opensora/utils/utils.py function to_2tuple (line 39) | def to_2tuple(x): function explicit_uniform_sampling (line 47) | def explicit_uniform_sampling(T, n, rank, bsz, device): function get_grad_norm (line 77) | def get_grad_norm( function clip_grad_norm_ (line 115) | def clip_grad_norm_( function get_experiment_dir (line 172) | def get_experiment_dir(root_dir, args): function get_precision (line 188) | def get_precision(args): function create_logger (line 201) | def create_logger(logging_dir): function create_tensorboard (line 221) | def create_tensorboard(tensorboard_dir): function write_tensorboard (line 232) | def write_tensorboard(writer, *args): function get_npu_power (line 240) | def get_npu_power(): function monitor_npu_power (line 261) | def monitor_npu_power(): function update_ema (line 272) | def update_ema(ema_model, model, decay=0.9999): function requires_grad (line 284) | def requires_grad(model, flag=True): function cleanup (line 292) | def cleanup(): function set_seed (line 300) | def set_seed(seed, rank, device_specific=True): function setup_distributed (line 311) | def setup_distributed(backend="nccl", port=None): function collect_env (line 352) | def collect_env(): function text_preprocessing (line 375) | def text_preprocessing(text, support_Chinese=True): function basic_clean (line 380) | def basic_clean(text): function clean_caption (line 385) | def clean_caption(caption, support_Chinese=True):