Struct type as a class argument

class people:
    def __init__(self,a,b):

I want self.b to be a struct type in C/matlab so that self.b.field1=field1, self.b.field2=field2. How to do this?

I don’t understand this requirement, since you are creating a Python class, which cannot directly interact with C/Matlab. You could transform raw Matlab objects, but still I’m unsure if that’s your use case.

You can directly assign attributes in Python. Also, your question doesn’t seem to be related to PyTorch, so a Python-specific discussion board might be a better place to ask.

Thank you, I’ll try finding a Python forum. BTW, my intention is not to interact with C/Matlab, but to mimic them to create self.b variable in this class so that self.b.field1=field1, self.b.field2=field2 etc can be created afterwards