You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: sptensor.m
    path of file: ./repos/tensor_toolbox/@sptensor
    
    the code of the file until where you have to start completion: %SPTENSOR Class for sparse tensors.
%
%SPTENSOR Methods:
%   and        - Logical AND (&) for sptensors.
%   collapse   - Collapse sparse tensor along specified dimensions.
%   contract   - Contract sparse tensor along two dimensions (array trace).
%   ctranspose - is not defined for sparse tensors.
%   disp       - Command window display of a sparse tensor.
%   display    - Command window display of a sparse tensor.
%   divide     - Divide an SPTENSOR by a nonnegative KTENSOR.
%   double     - Converts a sparse tensor to a dense multidimensional array.
%   elemfun    - Manipulate the nonzero elements of a sparse tensor.
%   end        - Last index of indexing expression for sparse tensor.
%   eq         - Equal (==) for sptensors.
%   find       - Find subscripts of nonzero elements in a sparse tensor.
%   full       - Convert a sparse tensor to a (dense) tensor.
%   ge         - Greater than or equal for sptensors.
%   gt         - Greater than for sptensors.
%   innerprod  - Efficient inner product with a sparse tensor.
%   isequal    - for sptensors.
%   ldivide    - Array right division for sparse tensors.
%   le         - Less than or equal for sptensors.
%   lt         - Less than for sptensors.
%   minus      - Binary subtraction for sparse tensors. 
%   mldivide   - Slash left division for sparse tensors.
%   mrdivide   - Slash right division for sparse tensors.
%   mtimes     - sptensor-scalar multiplication.
%   mttkrp     - Matricized tensor times Khatri-Rao product for sparse tensor.
%   ndims      - Number of dimensions of a sparse tensor.
%   ne         - Not equal (~=) for sptensors.
%   nnz        - Number of nonzeros in sparse tensor.
%   norm       - Frobenius norm of a sparse tensor.
%   not        - Logical NOT (~) for sptensors.
%   nvecs      - Compute the leading mode-n vectors for a sparse tensor.
%   ones       - Replace nonzero elements of sparse tensor with ones.
%   or         - Logical OR (|) for sptensors.
%   permute    - Rearrange the dimensions of a sparse tensor.
%   plus       - Bin
    
function t = sptensor(varargin)
%SPTENSOR Create a sparse tensor.
%
%   X = SPTENSOR(SUBS, VALS, SZ, FUN) uses the rows of SUBS and VALS
%   to generate a sparse tensor X of size SZ = [m1 m2 ... mn]. SUBS is
%   an p x n array specifying the subscripts of the values to be
%   inserted into S. The k-th row of SUBS specifies the subscripts for
%   the k-th value in VALS. The values are accumulated at repeated
%   subscripts using the function FUN, which is specified by a
%   function handle.
%
%   There are several simplifications of this four argument call.
%
%   X = SPTENSOR(SUBS,VALS,SZ) uses FUN=@SUM.
%
%   X = SPTENSOR(SUBS,VALS) uses SM = max(SUBS,[],1).
%
%   X = SPTENSOR(SZ) abbreviates X = SPTENSOR([],[],SZ).
%
%   X = SPTENSOR(Y) copies/converts Y if it is an sptensor, an sptenmat, or
%   a dense tensor or MDA (the zeros are squeezed out), an sptensor3, or a
%   sparse matrix. Note that a row-vector, integer MDA is interpreted as a
%   size (see previous constructor).
%
%   S = SPTENSOR is the empty constructor.
%
%   The argument VALS may be scalar, which is expanded to be the
%   same length as SUBS, i.e., it is equivalent to VALS*(p,1).
%
%   Examples
%   subs = [1 1 1; 1 1 3; 2 2 2; 4 4 4; 1 1 1; 1 1 1]
%   vals = [0.5; 1.5; 2.5; 3.5; 4.5; 5.5]
%   siz = [4 4 4];
%   X = sptensor(subs,vals,siz) %<-- sparse 4x4x4, repeats summed
%   X = sptensor(subs,1,siz) %<-- scalar 2nd argument
%   X = sptensor(subs,vals,siz,@max) %<-- max for accumulation
%   myfun = @(x) sum(x) / 3;
%   X = sptensor(subs,vals,siz,myfun) %<-- custom accumulation
%
%   See also SPTENSOR, SPTENRAND.
%
%MATLAB Tensor Toolbox.
%Copyright 2015, Sandia Corporation.

% This is the MATLAB Tensor Toolbox by T. Kolda, B. Bader, and others.
% http://www.sandia.gov/~tgkolda/TensorToolbox.
% Copyright (2015) Sandia Corporation. Under the terms of Contract
% DE-AC04-94AL85000, there is a non-exclusive license for use of this
% work by or on behalf of the U.S. Government. Export of this data may
% require a license from the United States Government.
% The full license terms can be found in the file LICENSE.txt


% EMPTY Constructor
if (nargin == 0) || ((nargin == 1) && isempty(varargin{1}))
    t.subs = [];
    t.vals = [];
    t.size = [];
    t = class(t,'sptensor');
    return;
end