torch_model_delete Subroutine

public subroutine torch_model_delete(model)

Deallocates a TorchScript model

Arguments

Type IntentOptional Attributes Name
type(torch_model), intent(in) :: model

Torch Model to deallocate


Source Code

  subroutine torch_model_delete(model)
    type(torch_model), intent(in) :: model     !! Torch Model to deallocate

    interface
      subroutine torch_jit_model_delete_c(model) &
          bind(c, name = 'torch_jit_module_delete')
        use, intrinsic :: iso_c_binding, only : c_ptr
        type(c_ptr), value, intent(in) :: model
      end subroutine torch_jit_model_delete_c
    end interface

    call torch_jit_model_delete_c(model%p)
  end subroutine torch_model_delete