def split(attrs, inputs, proto_obj):
    """Splits an array along a particular axis into multiple sub-arrays."""
    split_list = attrs.get('split') if 'split' in attrs else []
    new_attrs = translation_utils._fix_attribute_names(attrs,
                                                       {'split' : 'num_outputs'})
    if 'axis' not in attrs:
        new_attrs = translation_utils._add_extra_attributes(new_attrs, {'axis': 0})

    if not split_list:
        num_outputs = len(proto_obj.model_metadata.get('output_tensor_data'))
    else:
        if len(set(split_list)) == 1:
            num_outputs = len(split_list)
        else:
            raise NotImplementedError("Operator {} in MXNet does not support variable splits."
                                      "Tracking the issue to support variable split here: "
                                      "https://github.com/apache/incubator-mxnet/issues/11594"
                                      .format('split'))

    new_attrs['num_outputs'] = num_outputs
    return 'split', new_attrs, inputs
def split ( attrs , inputs , proto_obj ) : split_list = attrs . get ( 'split' ) if 'split' in attrs else [ ] new_attrs = translation_utils . _fix_attribute_names ( attrs , { 'split' : 'num_outputs' } ) if 'axis' not in attrs : new_attrs = translation_utils . _add_extra_attributes ( new_attrs , { 'axis' : 0 } ) if not split_list : num_outputs = len ( proto_obj . model_metadata . get ( 'output_tensor_data' ) ) else : if len ( set ( split_list ) ) == 1 : num_outputs = len ( split_list ) else : raise NotImplementedError ( "Operator {} in MXNet does not support variable splits." "Tracking the issue to support variable split here: " "https://github.com/apache/incubator-mxnet/issues/11594" . format ( 'split' ) ) new_attrs [ 'num_outputs' ] = num_outputs return 'split' , new_attrs , inputs
Splits an array along a particular axis into multiple sub-arrays.