Skip to content

/AWS1/IF_SGI=>GETTRAININGOPERATIONRESULT()

About GetTrainingOperationResult

Retrieves the current status and result of a previously submitted training operation. Poll this operation until the status reaches a terminal state (Completed, Failed, or Skipped).

Method Signature

METHODS /AWS1/IF_SGI~GETTRAININGOPERATIONRESULT
  IMPORTING
    !IV_TRAININGSESSIONNAME TYPE /AWS1/SGITRAININGSESSIONNAME OPTIONAL
    !IV_OPERATIONID TYPE /AWS1/SGIOPERATIONID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_sgigettrnoprsltoutput
  RAISING
    /AWS1/CX_SGIINTERNALSERVEREX
    /AWS1/CX_SGIRESOURCENOTFOUNDEX
    /AWS1/CX_SGITHROTTLINGEX
    /AWS1/CX_SGIVLDTNEXCEPTION
    /AWS1/CX_SGICLIENTEXC
    /AWS1/CX_SGISERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_trainingsessionname TYPE /AWS1/SGITRAININGSESSIONNAME /AWS1/SGITRAININGSESSIONNAME

The name of the training session that owns the operation.

iv_operationid TYPE /AWS1/SGIOPERATIONID /AWS1/SGIOPERATIONID

The unique identifier of the operation to retrieve, returned by ExecuteTrainingOperation.

RETURNING

oo_output TYPE REF TO /aws1/cl_sgigettrnoprsltoutput /AWS1/CL_SGIGETTRNOPRSLTOUTPUT

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->gettrainingoperationresult(
  iv_operationid = |string|
  iv_trainingsessionname = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_requeststatus = lo_result->get_status( ).
  lo_operationresult = lo_result->get_operationresult( ).
  IF lo_operationresult IS NOT INITIAL.
    lo_forwardresult = lo_operationresult->get_forward( ).
    IF lo_forwardresult IS NOT INITIAL.
      lv_string = lo_forwardresult->get_lossfnoutputtype( ).
      LOOP AT lo_forwardresult->get_lossfnoutputs( ) into lt_row.
        LOOP AT lt_row into ls_row_1.
          lv_key = ls_row_1-key.
          lo_value = ls_row_1-value.
          IF lo_value IS NOT INITIAL.
            lo_/aws1/cl_rt_document = lo_value->get_data( ).
            IF lo_/aws1/cl_rt_document IS NOT INITIAL.
            ENDIF.
            lv_string = lo_value->get_dtype( ).
            LOOP AT lo_value->get_shape( ) into lo_row_2.
              lo_row_3 = lo_row_2.
              IF lo_row_3 IS NOT INITIAL.
                lv_integer = lo_row_3->get_value( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDLOOP.
      ENDLOOP.
      LOOP AT lo_forwardresult->get_metrics( ) into ls_row_4.
        lv_key = ls_row_4-key.
        lo_value_1 = ls_row_4-value.
        IF lo_value_1 IS NOT INITIAL.
          lv_double = lo_value_1->get_value( ).
        ENDIF.
      ENDLOOP.
      lo_trainingtokenusage = lo_forwardresult->get_tokenusage( ).
      IF lo_trainingtokenusage IS NOT INITIAL.
        lv_integer = lo_trainingtokenusage->get_trainingtokens( ).
      ENDIF.
    ENDIF.
    lo_forwardbackwardresult = lo_operationresult->get_forwardbackward( ).
    IF lo_forwardbackwardresult IS NOT INITIAL.
      lv_string = lo_forwardbackwardresult->get_lossfnoutputtype( ).
      LOOP AT lo_forwardbackwardresult->get_lossfnoutputs( ) into lt_row.
        LOOP AT lt_row into ls_row_1.
          lv_key = ls_row_1-key.
          lo_value = ls_row_1-value.
          IF lo_value IS NOT INITIAL.
            lo_/aws1/cl_rt_document = lo_value->get_data( ).
            IF lo_/aws1/cl_rt_document IS NOT INITIAL.
            ENDIF.
            lv_string = lo_value->get_dtype( ).
            LOOP AT lo_value->get_shape( ) into lo_row_2.
              lo_row_3 = lo_row_2.
              IF lo_row_3 IS NOT INITIAL.
                lv_integer = lo_row_3->get_value( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDLOOP.
      ENDLOOP.
      LOOP AT lo_forwardbackwardresult->get_metrics( ) into ls_row_4.
        lv_key = ls_row_4-key.
        lo_value_1 = ls_row_4-value.
        IF lo_value_1 IS NOT INITIAL.
          lv_double = lo_value_1->get_value( ).
        ENDIF.
      ENDLOOP.
      lo_trainingtokenusage = lo_forwardbackwardresult->get_tokenusage( ).
      IF lo_trainingtokenusage IS NOT INITIAL.
        lv_integer = lo_trainingtokenusage->get_trainingtokens( ).
      ENDIF.
    ENDIF.
    lo_optimizerstepresult = lo_operationresult->get_optimizerstep( ).
    IF lo_optimizerstepresult IS NOT INITIAL.
      LOOP AT lo_optimizerstepresult->get_metrics( ) into ls_row_4.
        lv_key = ls_row_4-key.
        lo_value_1 = ls_row_4-value.
        IF lo_value_1 IS NOT INITIAL.
          lv_double = lo_value_1->get_value( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
    lo_saveweightsresult = lo_operationresult->get_saveweights( ).
    IF lo_saveweightsresult IS NOT INITIAL.
      lv_string = lo_saveweightsresult->get_modelpackagearn( ).
    ENDIF.
    lo_savestateresult = lo_operationresult->get_savestate( ).
    IF lo_savestateresult IS NOT INITIAL.
      lv_string = lo_savestateresult->get_modelpackagearn( ).
    ENDIF.
    lo_loadstateresult = lo_operationresult->get_loadstate( ).
    IF lo_loadstateresult IS NOT INITIAL.
    ENDIF.
  ENDIF.
  lv_string = lo_result->get_errordetails( ).
  lo_trainingtokenusage = lo_result->get_tokenusage( ).
  IF lo_trainingtokenusage IS NOT INITIAL.
    lv_integer = lo_trainingtokenusage->get_trainingtokens( ).
  ENDIF.
ENDIF.

Get the result of a training operation

Retrieves the status and result of a training operation submitted with ExecuteTrainingOperation.

DATA(lo_result) = lo_client->gettrainingoperationresult(
  iv_operationid = |a1b2c3d4-5678-90ab-cdef-1234567890ab|
  iv_trainingsessionname = |my-training-session|
).