{"record":{"id":"affb9d5481aa9484","repo":"Stability-AI/generative-models","slug":"notimplementederror-affb9d","errorCode":null,"errorMessage":"NotImplementedError","messagePattern":"NotImplementedError","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"sgm/modules/diffusionmodules/video_model.py","lineNumber":582,"sourceCode":"            get_alpha,\n            merge_strategy,\n            self.mix_factor,\n            apply_sigmoid=apply_sigmoid_to_merge,\n        )\n\n    def forward(\n        self,\n        x: th.Tensor,\n        context: Optional[th.Tensor] = None,\n        # cam: Optional[th.Tensor] = None,\n        time_context: Optional[th.Tensor] = None,\n        timesteps: Optional[int] = None,\n        image_only_indicator: Optional[th.Tensor] = None,\n        conv_view: Optional[th.Tensor] = None,\n        conv_motion: Optional[th.Tensor] = None,\n    ):\n        if time_context is not None:\n            raise NotImplementedError\n\n        _, _, h, w = x.shape\n        if exists(context):\n            context = rearrange(context, \"b t ... -> (b t) ...\")\n        if self.use_spatial_context:\n            time_context = repeat(context[:, 0], \"b ... -> (b n) ...\", n=h * w)\n\n        x = super().forward(\n            x,\n        )\n\n        x = rearrange(x, \"b c h w -> b (h w) c\")\n        x_mix = x\n\n        num_frames = th.arange(timesteps, device=x.device)\n        num_frames = repeat(num_frames, \"t -> b t\", b=x.shape[0] // timesteps)\n        num_frames = rearrange(num_frames, \"b t -> (b t)\")\n        t_emb = timestep_embedding(num_frames, self.in_channels, repeat_only=False)","sourceCodeStart":564,"sourceCodeEnd":600,"githubUrl":"https://github.com/Stability-AI/generative-models/blob/e8cd657656fa5d61688191730d0e03242bf4ed44/sgm/modules/diffusionmodules/video_model.py#L564-L600","documentation":"VideoDepthModel/VideoUNet.forward raises NotImplementedError when time_context is passed: the forward path in this variant does not implement separate time-context injection. Passing a non-None time_context therefore aborts immediately as an explicitly unsupported code path.","triggerScenarios":"Calling model(x, timesteps, context=..., time_context=...) with a real tensor for time_context, e.g. reusing a call signature from a different video model version that supported split spatial/temporal context.","commonSituations":"Migrating code from an older/other SGM fork where time_context was supported, plugging a text/temporal encoder output into time_context, or a wrapper passing time_context unconditionally (even None it's fine; only non-None triggers).","solutions":["Pass time_context=None (omit it) and rely on the model's internal spatial/temporal context handling.","If you need time-context conditioning, use a model variant whose forward implements it, or patch forward to consume time_context.","Restructure so temporal information is folded into `context` instead of `time_context`."],"exampleFix":"// before\nout = model(x, t, context=ctx, time_context=t_ctx)\n// after\nout = model(x, t, context=ctx)  # time_context not supported by this forward","handlingStrategy":"try-catch","validationCode":"if time_context is not None:\n    raise TypeError(\"This forward does not support time_context; fold it into context\")","typeGuard":null,"tryCatchPattern":"try:\n    out = model(x, t, context=ctx, time_context=t_ctx)\nexcept NotImplementedError:\n    logger.warning(\"time_context unsupported; retrying without it\")\n    out = model(x, t, context=ctx)","preventionTips":["Check the forward signature of the exact model class before passing optional context tensors.","Gate time_context usage behind a feature check/version check of the codebase.","Merge temporal conditioning into `context` rather than passing time_context."],"tags":["pytorch","notimplementederror","api-mismatch"],"backgroundTag":"unimplemented-code-path","analyzedSha":"e8cd657656fa5d61688191730d0e03242bf4ed44","analyzedAt":"2026-08-29T11:23:43.234Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}