Skip to content
Discussion options

You must be logged in to vote

Aha, I see!

This is definitely feasible.

I've modified the snippet you sent:

import drjit as dr
import mitsuba as mi
import numpy as np

mi.set_variant('cuda_ad_rgb')

class Linear:
    def __init__(self, input_dims, output_dims):
        self.weight = mi.TensorXf(np.random.rand(output_dims, input_dims))
        self.bias = mi.Float(np.random.rand(output_dims))
        dr.make_opaque(self.weight, self.bias)

    def __call__(self, x):
        res = []
        width = dr.width(x[0])
        for i in range(self.weight.shape[0]):
            row = dr.ravel(self.weight[i])

            out = dr.zeros(mi.Float, shape=width)
            for j in range(self.weight.shape[1]):
                weight 

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@njroussel
Comment options

Answer selected by gerwang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants