classdef ReshapeLayer1000 < 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.ReshapeLayer1000';
        end
    end


    methods
        function this = ReshapeLayer1000(name)
            this.Name = name;
            this.OutputNames = {'model_1_separable_4'};
        end

        function [model_1_separable_4] = predict(this, main_input_0)
            if isdlarray(main_input_0)
                main_input_0 = stripdims(main_input_0);
            end
            main_input_0NumDims = 4;
            main_input_0 = EDHR_Net_SCNew.ops.permuteInputVar(main_input_0, [4 1 2 3], 4);

            [model_1_separable_4, model_1_separable_4NumDims] = ReshapeGraph1000(this, main_input_0, main_input_0NumDims, false);
            model_1_separable_4 = EDHR_Net_SCNew.ops.permuteOutputVar(model_1_separable_4, [3 4 2 1], 4);

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

        function [model_1_separable_4] = forward(this, main_input_0)
            if isdlarray(main_input_0)
                main_input_0 = stripdims(main_input_0);
            end
            main_input_0NumDims = 4;
            main_input_0 = EDHR_Net_SCNew.ops.permuteInputVar(main_input_0, [4 1 2 3], 4);

            [model_1_separable_4, model_1_separable_4NumDims] = ReshapeGraph1000(this, main_input_0, main_input_0NumDims, true);
            model_1_separable_4 = EDHR_Net_SCNew.ops.permuteOutputVar(model_1_separable_4, [3 4 2 1], 4);

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

        function [model_1_separable_4, model_1_separable_4NumDims1001] = ReshapeGraph1000(this, main_input_0, main_input_0NumDims, Training)

            % Execute the operators:
            % Reshape:
            [shape, model_1_separable_4NumDims] = EDHR_Net_SCNew.ops.prepareReshapeArgs(main_input_0, this.Vars.new_shape__606, main_input_0NumDims, 0);
            model_1_separable_4 = reshape(main_input_0, shape{:});

            % Set graph output arguments
            model_1_separable_4NumDims1001 = model_1_separable_4NumDims;

        end

    end

end