code: def setUp(self):
      config.set_backend("torch")
  
      variables = [
          "kid",
          "bowel-problem",
          "dog-out",
          "family-out",
          "hear-bark",
          "light-on",
      ]
  
      edges = [
          ["family-out", "dog-out"],
          ["bowel-problem", "dog-out"],
          ["family-out", "light-on"],
          ["dog-out", "hear-bark"],
      ]
  
      cpds = {
          "kid": np.array([[0.3], [0.7]]),
          "bowel-problem": np.array([[0.01], [0.99]]),
          "dog-out": np.array(
              [[0.99, 0.9, 0.97, 0.3], [0.01, 0.1, 0.03, 0.7]]
          ),
          "family-out": np.array([[0.15], [0.85]]),
          "hear-bark": np.array([[0.7, 0.01], [0.3, 0.99]]),
          "light-on": np.array([[0.6, 0.95], [0.4, 0.05]]),
      }
  
      states = {
          "kid": ["true", "false"],
          "bowel-problem": ["true", "false"],
          "dog-out": ["true", "false"],
          "family-out": ["true", "false"],
          "hear-bark": ["true", "false"],
          "light-on": ["true", "false"],
      }
  
      parents = {
          "kid": [],
          "bowel-problem": [],
          "dog-out": ["bowel-problem", "family-out"],
          "family-out": [],
          "hear-bark": ["dog-out"],
          "light-on": ["family-out"],
      }
  
      properties = {
          "kid": ["position = (100, 165)"],
          "bowel-problem": ["position = (335, 99)"],
          "dog-out": ["position = (300, 195)"],
          "family-out": ["position = (257, 99)"],
          "hear-bark": ["position = (296, 268)"],
          "light-on": ["position = (218, 195)"],
      }
  
      self.model = BayesianNetwork()
      self.model.add_nodes_from(variables)
      self.model.add_edges_from(edges)
  
      tabular_cpds = []
      for var in sorted(cpds.keys()):
          values = cpds[var]
          cpd = TabularCPD(
              var,
              len(states[var]),
              values,
              evidence=parents[var],
              evidence_card=[
                  len(states[evidence_var])
                  for evidence_var in parents[var]
              ],
          )
          tabular_cpds.append(cpd)
      self.model.add_cpds(*tabular_cpds)
  
      for node, properties in properties.items():
          for prop in properties:
              prop_name, prop_value = map(
                  lambda t: t.strip(), prop.split("=")
              )
              self.model.nodes[node][prop_name] = prop_value
  
      self.writer = BIFWriter(model=self.model, round_values=4)
  
imports: import os
  import unittest
  import networkx
  import numpy
  import numpy.testing
  from pgmpy import config
  from pgmpy.factors.discrete import TabularCPD
  from pgmpy.models import BayesianNetwork
  from pgmpy.readwrite import BIFReader, BIFWriter
label_desc: Use image node_id 1 for calling the TestBIFWriterTorch obj's underlying member method code with example usage: obj.setUp() without return types