How to use the eagerpy.tensor.base.istensor function in eagerpy

To help you get started, we’ve selected a few eagerpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jonasrauber / eagerpy / eagerpy / tensor / pytorch.py View on Github external
def minimum(self, other):
        if istensor(other):
            other = other.tensor
        else:
            other = self.backend.ones_like(self.tensor) * other
        return self.backend.min(self.tensor, other)
github jonasrauber / eagerpy / eagerpy / tensor / pytorch.py View on Github external
def maximum(self, other):
        if istensor(other):
            other = other.tensor
        else:
            other = self.backend.ones_like(self.tensor) * other
        return self.backend.max(self.tensor, other)

eagerpy

EagerPy is a thin wrapper around PyTorch, TensorFlow Eager, JAX and NumPy that unifies their interface and thus allows writing code that works natively across all of them.

MIT
Latest version published 3 years ago

Package Health Score

46 / 100
Full package analysis