classdef ReshapeLayer1001 < nnet.layer.Layer & nnet.layer.Formattable
    % A custom layer auto-generated while importing an ONNX network.

    %#ok<*PROPLC>
    %#ok<*NBRAK>
    %#ok<*INUSL>
    %#ok<*VARARG>
    properties (Learnable)
    end

    properties (State)
    end

    properties
        Vars
        NumDims
    end


    methods(Static, Hidden)
        % Specify the path to the class that will be used for codegen
        function name = matlabCodegenRedirect(~)
            name = 'EDHR_Net_SCNew.coder.ReshapeLayer1001';
        end
    end


    methods
        function this = ReshapeLayer1001(name)
            this.Name = name;
            this.OutputNames = {'model_1_separable_co'};
        end

        function [model_1_separable_co] = predict(this, model_1_separable_3)
            if isdlarray(model_1_separable_3)
                model_1_separable_3 = stripdims(model_1_separable_3);
            end
            model_1_separable_3NumDims = 4;
            model_1_separable_3 = EDHR_Net_SCNew.ops.permuteInputVar(model_1_separable_3, [4 3 1 2], 4);

            [model_1_separable_co, model_1_separable_coNumDims] = ReshapeGraph1002(this, model_1_separable_3, model_1_separable_3NumDims, false);
            model_1_separable_co = EDHR_Net_SCNew.ops.permuteOutputVar(model_1_separable_co, [3 4 2 1], 4);

            model_1_separable_co = dlarray(single(model_1_separable_co), 'SSCB');
        end

        function [model_1_separable_co] = forward(this, model_1_separable_3)
            if isdlarray(model_1_separable_3)
                model_1_separable_3 = stripdims(model_1_separable_3);
            end
            model_1_separable_3NumDims = 4;
            model_1_separable_3 = EDHR_Net_SCNew.ops.permuteInputVar(model_1_separable_3, [4 3 1 2], 4);

            [model_1_separable_co, model_1_separable_coNumDims] = ReshapeGraph1002(this, model_1_separable_3, model_1_separable_3NumDims, true);
            model_1_separable_co = EDHR_Net_SCNew.ops.permuteOutputVar(model_1_separable_co, [3 4 2 1], 4);

            model_1_separable_co = dlarray(single(model_1_separable_co), 'SSCB');
        end

        function [model_1_separable_co, model_1_separable_coNumDims1003] = ReshapeGraph1002(this, model_1_separable_3, model_1_separable_3NumDims, Training)

            % Execute the operators:
            % Reshape:
            [shape, model_1_separable_coNumDims] = EDHR_Net_SCNew.ops.prepareReshapeArgs(model_1_separable_3, this.Vars.new_shape__606, model_1_separable_3NumDims, 0);
            model_1_separable_co = reshape(model_1_separable_3, shape{:});

            % Set graph output arguments
            model_1_separable_coNumDims1003 = model_1_separable_coNumDims;

        end

    end

end