code: def memory_allocated(self, device_index=None):
      return torch.mps.current_allocated_memory()
  
imports: import torch
  from .abstract_accelerator import DeepSpeedAccelerator
label_desc: Use image node_id 24 for calling the MPS_Accelerator obj's underlying member method code with example usage: obj.memory_allocated(device_index) and returns: torch