code: def batched_linspace(
      start: Tensor, end: Tensor, step: int, dim: int
  ) -> Tensor:
      """Batch version of torch.normalize (similar to the numpy one)."""
      intervals = ((end - start) / (step - 1)).unsqueeze(dim)
      broadcast_size = [1] * len(intervals.shape)
      broadcast_size[dim] = step
      samples = torch.arange(
          step, dtype=torch.float, device=start.device
      ).reshape(broadcast_size)
      samples = start.unsqueeze(dim) + samples * intervals
      return samples
  
imports: from typing import Any, Dict, Optional, Tuple
  import torch
  import torch.nn.functional
  from kornia.core import Module, Tensor, concatenate, pad, stack
  from kornia.core.check import KORNIA_CHECK_SHAPE
  from kornia.geometry.conversions import normalize_pixel_coordinates
  from kornia.utils import map_location_to_cpu
  from .backbones import SOLD2Net
  from .sold2_detector import LineSegmentDetectionModule, line_map_to_segments, prob_to_junctions
label_desc: Use image node_id 2 for calling a global function with example usage: batched_linspace(start, end, step, dim) and returns: samples