narrow

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

Return a new tensor that is a narrowed version of input tensor.

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

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