torch_tensor_from_array Interface

public interface torch_tensor_from_array

Interface for directing torch_tensor_from_array to possible input types and ranks Signature: (tensor, data, device_type, [device_index], [permute_dims], [requires_grad])

Calls

interface~~torch_tensor_from_array~~CallsGraph interface~torch_tensor_from_array torch_tensor_from_array proc~torch_tensor_from_array_int16_1d torch_tensor_from_array_int16_1d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int16_1d proc~torch_tensor_from_array_int16_2d torch_tensor_from_array_int16_2d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int16_2d proc~torch_tensor_from_array_int16_3d torch_tensor_from_array_int16_3d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int16_3d proc~torch_tensor_from_array_int16_4d torch_tensor_from_array_int16_4d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int16_4d proc~torch_tensor_from_array_int16_5d torch_tensor_from_array_int16_5d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int16_5d proc~torch_tensor_from_array_int32_1d torch_tensor_from_array_int32_1d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int32_1d proc~torch_tensor_from_array_int32_2d torch_tensor_from_array_int32_2d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int32_2d proc~torch_tensor_from_array_int32_3d torch_tensor_from_array_int32_3d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int32_3d proc~torch_tensor_from_array_int32_4d torch_tensor_from_array_int32_4d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int32_4d proc~torch_tensor_from_array_int32_5d torch_tensor_from_array_int32_5d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int32_5d proc~torch_tensor_from_array_int64_1d torch_tensor_from_array_int64_1d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int64_1d proc~torch_tensor_from_array_int64_2d torch_tensor_from_array_int64_2d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int64_2d proc~torch_tensor_from_array_int64_3d torch_tensor_from_array_int64_3d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int64_3d proc~torch_tensor_from_array_int64_4d torch_tensor_from_array_int64_4d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int64_4d proc~torch_tensor_from_array_int64_5d torch_tensor_from_array_int64_5d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int64_5d proc~torch_tensor_from_array_int8_1d torch_tensor_from_array_int8_1d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int8_1d proc~torch_tensor_from_array_int8_2d torch_tensor_from_array_int8_2d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int8_2d proc~torch_tensor_from_array_int8_3d torch_tensor_from_array_int8_3d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int8_3d proc~torch_tensor_from_array_int8_4d torch_tensor_from_array_int8_4d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int8_4d proc~torch_tensor_from_array_int8_5d torch_tensor_from_array_int8_5d interface~torch_tensor_from_array->proc~torch_tensor_from_array_int8_5d proc~torch_tensor_from_array_real32_1d torch_tensor_from_array_real32_1d interface~torch_tensor_from_array->proc~torch_tensor_from_array_real32_1d proc~torch_tensor_from_array_real32_2d torch_tensor_from_array_real32_2d interface~torch_tensor_from_array->proc~torch_tensor_from_array_real32_2d proc~torch_tensor_from_array_real32_3d torch_tensor_from_array_real32_3d interface~torch_tensor_from_array->proc~torch_tensor_from_array_real32_3d proc~torch_tensor_from_array_real32_4d torch_tensor_from_array_real32_4d interface~torch_tensor_from_array->proc~torch_tensor_from_array_real32_4d proc~torch_tensor_from_array_real32_5d torch_tensor_from_array_real32_5d interface~torch_tensor_from_array->proc~torch_tensor_from_array_real32_5d proc~torch_tensor_from_array_real64_1d torch_tensor_from_array_real64_1d interface~torch_tensor_from_array->proc~torch_tensor_from_array_real64_1d proc~torch_tensor_from_array_real64_2d torch_tensor_from_array_real64_2d interface~torch_tensor_from_array->proc~torch_tensor_from_array_real64_2d proc~torch_tensor_from_array_real64_3d torch_tensor_from_array_real64_3d interface~torch_tensor_from_array->proc~torch_tensor_from_array_real64_3d proc~torch_tensor_from_array_real64_4d torch_tensor_from_array_real64_4d interface~torch_tensor_from_array->proc~torch_tensor_from_array_real64_4d proc~torch_tensor_from_array_real64_5d torch_tensor_from_array_real64_5d interface~torch_tensor_from_array->proc~torch_tensor_from_array_real64_5d proc~torch_tensor_from_blob torch_tensor_from_blob proc~torch_tensor_from_array_int16_1d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int16_2d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int16_3d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int16_4d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int16_5d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int32_1d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int32_2d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int32_3d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int32_4d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int32_5d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int64_1d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int64_2d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int64_3d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int64_4d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int64_5d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int8_1d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int8_2d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int8_3d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int8_4d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_int8_5d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_real32_1d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_real32_2d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_real32_3d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_real32_4d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_real32_5d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_real64_1d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_real64_2d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_real64_3d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_real64_4d->proc~torch_tensor_from_blob proc~torch_tensor_from_array_real64_5d->proc~torch_tensor_from_blob interface~torch_from_blob_c torch_from_blob_c proc~torch_tensor_from_blob->interface~torch_from_blob_c

Module Procedures

public subroutine torch_tensor_from_array_int8_1d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 1 containing data of type int8 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int8), intent(in), pointer, contiguous :: data_in(:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(1)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int8_2d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 2 containing data of type int8 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int8), intent(in), pointer, contiguous :: data_in(:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(2)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int8_3d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 3 containing data of type int8 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int8), intent(in), pointer, contiguous :: data_in(:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(3)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int8_4d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 4 containing data of type int8 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int8), intent(in), pointer, contiguous :: data_in(:,:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(4)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int8_5d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 5 containing data of type int8 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int8), intent(in), pointer, contiguous :: data_in(:,:,:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(5)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int16_1d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 1 containing data of type int16 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int16), intent(in), pointer, contiguous :: data_in(:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(1)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int16_2d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 2 containing data of type int16 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int16), intent(in), pointer, contiguous :: data_in(:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(2)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int16_3d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 3 containing data of type int16 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int16), intent(in), pointer, contiguous :: data_in(:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(3)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int16_4d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 4 containing data of type int16 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int16), intent(in), pointer, contiguous :: data_in(:,:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(4)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int16_5d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 5 containing data of type int16 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int16), intent(in), pointer, contiguous :: data_in(:,:,:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(5)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int32_1d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 1 containing data of type int32 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int32), intent(in), pointer, contiguous :: data_in(:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(1)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int32_2d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 2 containing data of type int32 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int32), intent(in), pointer, contiguous :: data_in(:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(2)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int32_3d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 3 containing data of type int32 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int32), intent(in), pointer, contiguous :: data_in(:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(3)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int32_4d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 4 containing data of type int32 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int32), intent(in), pointer, contiguous :: data_in(:,:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(4)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int32_5d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 5 containing data of type int32 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int32), intent(in), pointer, contiguous :: data_in(:,:,:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(5)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int64_1d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 1 containing data of type int64 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int64), intent(in), pointer, contiguous :: data_in(:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(1)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int64_2d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 2 containing data of type int64 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int64), intent(in), pointer, contiguous :: data_in(:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(2)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int64_3d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 3 containing data of type int64 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int64), intent(in), pointer, contiguous :: data_in(:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(3)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int64_4d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 4 containing data of type int64 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int64), intent(in), pointer, contiguous :: data_in(:,:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(4)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_int64_5d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 5 containing data of type int64 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

integer(kind=int64), intent(in), pointer, contiguous :: data_in(:,:,:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(5)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_real32_1d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 1 containing data of type real32 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

real(kind=real32), intent(in), pointer, contiguous :: data_in(:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(1)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_real32_2d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 2 containing data of type real32 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

real(kind=real32), intent(in), pointer, contiguous :: data_in(:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(2)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_real32_3d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 3 containing data of type real32 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

real(kind=real32), intent(in), pointer, contiguous :: data_in(:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(3)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_real32_4d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 4 containing data of type real32 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

real(kind=real32), intent(in), pointer, contiguous :: data_in(:,:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(4)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_real32_5d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 5 containing data of type real32 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

real(kind=real32), intent(in), pointer, contiguous :: data_in(:,:,:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(5)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_real64_1d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 1 containing data of type real64 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

real(kind=real64), intent(in), pointer, contiguous :: data_in(:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(1)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_real64_2d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 2 containing data of type real64 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

real(kind=real64), intent(in), pointer, contiguous :: data_in(:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(2)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_real64_3d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 3 containing data of type real64 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

real(kind=real64), intent(in), pointer, contiguous :: data_in(:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(3)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_real64_4d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 4 containing data of type real64 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

real(kind=real64), intent(in), pointer, contiguous :: data_in(:,:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(4)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor

public subroutine torch_tensor_from_array_real64_5d(tensor, data_in, device_type, device_index, permute_dims, requires_grad)

Return a Torch tensor pointing to data_in array of rank 5 containing data of type real64 This subroutine is part of an interface and should be accessed through torch_tensor_from_array.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(out) :: tensor

Returned tensor

real(kind=real64), intent(in), pointer, contiguous :: data_in(:,:,:,:,:)

Input data that tensor will point at

integer(kind=c_int), intent(in) :: device_type

Device type the tensor will live on (torch_kCPU or a GPU device type)

integer, intent(in), optional :: device_index

Device index for GPU devices

integer(kind=int32), intent(in), optional :: permute_dims(5)

Permutation of dimensions to be applied to Fortran data in the resulting tensor. Takes the form of an array of length n with elements 1 to n, where n is the rank. Element i indicates which dimension of the Fortran array appears as dimension i on the Torch tensor. e.g. a Fortran array of shape [10, 20, 30] permuted by [2, 3, 1] will result in Torch shape [20, 30, 10]. This matches behaviour of torch.permute(), noting that this is Fortran so we index from 1!

logical, intent(in), optional :: requires_grad

Whether gradients need to be computed for the created tensor