mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-26 02:49:57 +08:00
added base class and methods; done logic for building graph
This commit is contained in:
1 parent
69ea3ae45e
commit
39346ccf40
5 files changed
+80
-40
No files matched your search
@@ -2,11 +2,11 @@
|
||||
Encoding functions
|
||||
"""
|
||||
import torch
|
||||
from torch import nn
|
||||
from torchtyping import TensorType
|
||||
from mattport.nerf.modules.module import Module
|
||||
|
||||
|
||||
class Encoding(nn.Module):
|
||||
class Encoding(Module):
|
||||
"""Encode an input tensor. Intended to be subclassed"""
|
||||
|
||||
def __init__(self, in_dim: int) -> None:
|
||||
@@ -19,21 +19,6 @@ class Encoding(nn.Module):
|
||||
raise ValueError("Input dimension should be greater than zero")
|
||||
self.in_dim = in_dim
|
||||
|
||||
def build_model(self) -> None:
|
||||
"""TODO: create base module class from which this extends"""
|
||||
|
||||
def set_in_dim(self, in_dim: int) -> None:
|
||||
"""TODO: create base module class from which this extends"""
|
||||
self.in_dim = in_dim
|
||||
|
||||
def get_out_dim(self) -> int:
|
||||
"""Calculates output dimension of encoding.
|
||||
|
||||
Returns:
|
||||
int: output dimension
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def encode(self, in_tensor: TensorType[..., "input_dim"]) -> TensorType[..., "output_dim"]:
|
||||
"""Encodes an input tensor.
|
||||
|
||||
|
||||
Reference in new issue
Block a user