code: def test_fit_line2(self, device, dtype):
      p0 = torch.tensor([0.0, 0.0], device=device, dtype=dtype)
      p1 = torch.tensor([1.0, 1.0], device=device, dtype=dtype)
  
      l1 = ParametrizedLine.through(p0, p1)
      num_points: int = 10
  
      pts = []
      for t in torch.linspace(-10, 10, num_points):
          p2 = l1.point_at(t)
          pts.append(p2)
      pts = torch.stack(pts)
  
      line_est = fit_line(pts[None])
      dir_exp = torch.tensor(
          [0.7071, 0.7071], device=device, dtype=dtype
      )
      # NOTE: for some reason the result in c[u/cuda differs
      angle_est = torch.nn.functional.cosine_similarity(
          line_est.direction, dir_exp, -1
      )
  
      angle_exp = torch.tensor([1.0], device=device, dtype=dtype)
      self.assert_close(angle_est.abs(), angle_exp)
  
imports: import pytest
  import torch
  from torch.autograd import gradcheck
  from kornia.geometry.line import ParametrizedLine, fit_line
  from kornia.geometry.plane import Hyperplane
  from kornia.testing import BaseTester, assert_close
label_desc: Use image node_id 2 for calling the TestFitLine obj's underlying member method code with example usage: obj.test_fit_line2(device, dtype) without return types