A transient implantable device for placement within a gastrointestinal tract controls absorption of nutrients. The device includes a float that connects with a bypass tube. The device maintains its position within the gastrointestinal tract by floating on gastric fluid within the stomach. The device is further placed in a way where consumed food can pass around the device normally through the digestive tract, or food can pass through the device. The bypass tube includes a series of openings that are selectively obstructed by a film to control material entering and exiting from the bypass tube.