code: def test_ones_and_zeros(self):
      for init_fn_, val in zip([init.ones_, init.zeros_], [1, 0]):
          for dims in [1, 2, 4]:
              input_tensor = self._create_random_nd_tensor(
                  dims, size_min=1, size_max=5
              )
              init_fn_(input_tensor)
  
              self.assertEqual(
                  input_tensor, input_tensor.clone().fill_(val)
              )
  
imports: import random
  import unittest
  import math
  import string
  from functools import reduce
  from operator import mul
  from torch.testing._internal.common_utils import TestCase, TEST_SCIPY, skipIfNoLapack, skipIfTorchDynamo, run_tests
  import torch
  import torch.nn.init
  import torch.nn.functional
label_desc: Use image node_id 17 for calling the TestNNInit obj's underlying member method code with example usage: obj.test_ones_and_zeros() without return types