Skip to content

Instantly share code, notes, and snippets.

View bridgesign's full-sized avatar

Rohan Patil bridgesign

View GitHub Profile
@bridgesign
bridgesign / BiCGSTAB.py
Last active February 29, 2024 14:37
BiCGSTAB or BCGSTAB Pytorch implementation GPU support
import torch
import warnings
class BiCGSTAB():
"""
This is a pytorch implementation of BiCGSTAB or BCGSTAB, a stable version
of the CGD method, published first by Van Der Vrost.
For solving ``Ax = b`` system.
@bridgesign
bridgesign / torch_printer.py
Created September 27, 2024 03:47
Torch Printer for sympy with full torch jit compatibility
# This is a modified version of the original file from the Modulus repository (NVIDIA)
# The original file can be found at:
# https://github.com/NVIDIA/modulus-sym/blob/main/modulus/sym/utils/sympy/torch_printer.py
# The original file is licensed under the Apache License, Version 2.0
# The modified file is provided under the same license
# The original file disclaimer is provided below:
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2024 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0