narrow

dragon.vm.torch.narrow(
  input,
  dimension,
  start,
  length
)[source]

Return a narrowed tensor of input.

Parameters:
  • input (torch.Tensor) – The input tensor.
  • dimension (int) – The dimension to slice.
  • start (int) – The starting position.
  • length (int) – The distance to the ending position.
Returns:

dragon.vm.torch.Tensor – The output tensor.