mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2026-02-27 08:46:00 +08:00
Reviewed By: inseokhwang Differential Revision: D54438157 fbshipit-source-id: a6acfe146ed29fff82123b5e458906d4b4cee6a2
52 lines
1.3 KiB
Python
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
|