# Path: gym3/internal/misc.py
# def intprod(xs):
# def allsame(xs):


from typing import Any, Callable, Tuple
from gym3.internal import misc
    """

    __eq__ = pod_equals


class TensorType(ValType):
    """
    A tensor value type

    :param eltype: instance of ScalarType subclass that represents the types of values in this tensor
    :param shape: shape of the tensor as a tuple of ints
    """

    def __init__(self, eltype: ScalarType, shape: Tuple) -> None:
        assert isinstance(shape, tuple)
        self.eltype = eltype
        self.shape = shape

    @property
    def ndim(self):
        """
        Number of dimensions of the tensor
        """
        return len(self.shape)

    @property
    def size(self):
        """
        Number of elements of the tensor
        """

# Path: gym3/internal/misc.py
# def intprod(xs):
# def allsame(xs):


# Path: gym3/types.py
from typing import Any, Callable, Tuple
from gym3.internal import misc

    """

    __eq__ = pod_equals


class TensorType(ValType):
    """
    A tensor value type

    :param eltype: instance of ScalarType subclass that represents the types of values in this tensor
    :param shape: shape of the tensor as a tuple of ints
    """

    def __init__(self, eltype: ScalarType, shape: Tuple) -> None:
        assert isinstance(shape, tuple)
        self.eltype = eltype
        self.shape = shape

    @property
    def ndim(self):
        """
        Number of dimensions of the tensor
        """
        return len(self.shape)

    @property
    def size(self):
        """
        Number of elements of the tensor
        """

        return int(misc.intprod(self.shape))