mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2026-03-15 17:05:58 +08:00
Enable __getitem__ for Cameras to return an instance of Cameras
Summary: Added a custom `__getitem__` method to `CamerasBase` which returns an instance of the appropriate camera instead of the `TensorAccessor` class. Long term we should deprecate the `TensorAccessor` and the `__getitem__` method on `TensorProperties` FB: In the next diff I will update the uses of `select_cameras` in implicitron. Reviewed By: bottler Differential Revision: D33185885 fbshipit-source-id: c31995d0eb126981e91ba61a6151d5404b263f67
This commit is contained in:
committed by
Facebook GitHub Bot
parent
cc3259ba93
commit
28ccdb7328
@@ -155,7 +155,7 @@ class TensorProperties(nn.Module):
|
||||
Returns:
|
||||
if `index` is an index int/slice return a TensorAccessor class
|
||||
with getattribute/setattribute methods which return/update the value
|
||||
at the index in the original camera.
|
||||
at the index in the original class.
|
||||
"""
|
||||
if isinstance(index, (int, slice)):
|
||||
return TensorAccessor(class_object=self, index=index)
|
||||
|
||||
Reference in New Issue
Block a user