mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-19 05:40:34 +08:00
allow changes to background_color in BlendParams (#64)
Summary: BlendParams background_color is immutable , type hint as a sequence allows setting new values in constructor. Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/64 Reviewed By: bottler Differential Revision: D20068911 Pulled By: nikhilaravi fbshipit-source-id: c580a7654dca25629218513841aa16d9d1055588
This commit is contained in:
committed by
Facebook Github Bot
parent
4233c32887
commit
a0f3dc2d63
@@ -234,3 +234,12 @@ class TestBlending(unittest.TestCase):
|
||||
|
||||
self.assertTrue(torch.allclose(dists1.grad, dists2.grad, atol=2e-5))
|
||||
self.assertTrue(torch.allclose(zbuf1.grad, zbuf2.grad, atol=2e-5))
|
||||
|
||||
def test_blend_params(self):
|
||||
"""Test colour parameter of BlendParams().
|
||||
Assert passed value overrides default value.
|
||||
"""
|
||||
bp_default = BlendParams()
|
||||
bp_new = BlendParams(background_color=(0.5, 0.5, 0.5))
|
||||
self.assertEqual(bp_new.background_color, (0.5, 0.5, 0.5))
|
||||
self.assertEqual(bp_default.background_color, (1.0, 1.0, 1.0))
|
||||
|
||||
Reference in New Issue
Block a user