Best Python code snippet using autotest_python
test_nb_render.py
Source:test_nb_render.py
...10except:11 pass12@pytest.mark.skipif(not torch.cuda.is_available(), 13 reason='No GPU device has been found.')14def test_base_render():15 n_rays = 12816 N_samples_per_ray = 6417 raw = torch.rand((n_rays, N_samples_per_ray, 4))18 z_vals = torch.rand((n_rays, N_samples_per_ray))19 rays_d = torch.rand((n_rays, 3))20 data = {'raw': raw, 'z_vals': z_vals, 'rays_d': rays_d}21 render_cfg = dict( # render model22 type='NerfRender',23 white_bkgd=False,24 raw_noise_std=0,25 )26 render = build_render(render_cfg)27 data, ret = render(data)28 assert isinstance(ret['rgb'], torch.Tensor)29 assert ret['rgb'].shape[0] == n_rays30 assert ret['rgb'].shape[1] == 331if __name__ == '__main__':...
test_an_render.py
Source:test_an_render.py
...10except:11 pass12@pytest.mark.skipif(not torch.cuda.is_available(), 13 reason='No GPU device has been found.')14def test_base_render():15 n_rays = 12816 N_samples_per_ray = 6417 raw = torch.rand((n_rays, N_samples_per_ray, 4))18 z_vals = torch.rand((n_rays, N_samples_per_ray))19 rays_d = torch.rand((n_rays, 3))20 data = {'raw': raw, 'z_vals': z_vals, 'rays_d': rays_d}21 render_cfg = dict( # render model22 type='NerfRender',23 white_bkgd=False,24 raw_noise_std=0,25 )26 render = build_render(render_cfg)27 data, ret = render(data)28 assert isinstance(ret['rgb'], torch.Tensor)29 assert ret['rgb'].shape[0] == n_rays30 assert ret['rgb'].shape[1] == 331if __name__ == '__main__':...
tests.py
Source:tests.py
...5 text = forms.CharField(label='label_text')6class FilterTest(TestCase):7 def setUp(self):8 self.context = Context({'form': TestKubeForm()})9 def test_base_render(self):10 template = Template('{% load kube %}{{ form|kubecolumn }}')11 rendered = template.render(self.context)12 self.assertIn('<p>', rendered)13 def test_inline_filter(self):14 template = Template('{% load kube %}{{ form|kubeinline }}')15 rendered = template.render(self.context)16 self.assertIn('class="units-row"', rendered)17 def test_field_render(self):18 template = Template('{% load kube %}{{ form.text|kubewidth:"50" }}')19 rendered = template.render(self.context)...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!