network_copy Module Subroutine

module subroutine network_copy(this, source)

Procedure to copy a network

Arguments

Type IntentOptional Attributes Name
class(network_type), intent(inout) :: this

Instance of network

type(network_type), intent(in), target :: source

Instance of network to be copied


Source Code

  module subroutine network_copy(this, source)
    !! Procedure to copy a network
    implicit none

    ! Arguments
    class(network_type), intent(inout) :: this
    !! Instance of network
    type(network_type), intent(in), target :: source
    !! Instance of network to be copied

    ! Local variables
    integer :: i
    !! Loop index


    this%metrics = source%metrics
    this%model   = source%model
    this%num_layers = source%num_layers
    this%batch_size = source%batch_size
    this%num_params = source%num_params
    this%num_outputs = source%num_outputs
    this%optimiser = source%optimiser
    this%vertex_order = source%vertex_order
    this%root_vertices = source%root_vertices
    this%leaf_vertices = source%leaf_vertices
    this%loss = source%loss
    this%get_accuracy => source%get_accuracy
    this%auto_graph = source%auto_graph

  end subroutine network_copy