Files
pytorch3d/pytorch3d/implicitron/models/implicit_function/base.py
Conner Nilsen a27755db41 Pyre Configurationless migration for] [batch:85/112] [shard:6/N]
Reviewed By: inseokhwang

Differential Revision: D54438157

fbshipit-source-id: a6acfe146ed29fff82123b5e458906d4b4cee6a2
2024-03-04 18:30:37 -08:00

52 lines
1.3 KiB
Python

# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
# pyre-unsafe
from abc import ABC, abstractmethod
from typing import Optional
from pytorch3d.implicitron.models.renderer.base import ImplicitronRayBundle
from pytorch3d.implicitron.tools.config import ReplaceableBase
from pytorch3d.renderer.cameras import CamerasBase
class ImplicitFunctionBase(ABC, ReplaceableBase):
@abstractmethod
def forward(
self,
*,
ray_bundle: ImplicitronRayBundle,
fun_viewpool=None,
camera: Optional[CamerasBase] = None,
global_code=None,
**kwargs,
):
raise NotImplementedError()
@staticmethod
def allows_multiple_passes() -> bool:
"""
Returns True if this implicit function allows
multiple passes.
"""
return False
@staticmethod
def requires_pooling_without_aggregation() -> bool:
"""
Returns True if this implicit function needs
pooling without aggregation.
"""
return False
def on_bind_args(self) -> None:
"""
Called when the custom args are fixed in the main model forward pass.
"""
pass